Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/components/FloatingAssistant/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ const FloatingAssistant: React.FC = () => {
const [isTutorialsPage, setIsTutorialsPage] = useState(
() => typeof window !== 'undefined' && isTutorialsPath(window.location.pathname),
);
// Older-version wrapper pages (e.g. /docs/26.9.0.cl) load the frozen version's site in a
// nested iframe (VersionIframe, src carries ?_iframe=1). The wrapper already mounts its own
// assistant, so the nested copy must not render a second one. Read once at load: the flag
// is on the iframe's initial URL, and in-page navigation inside it may drop the param.
const [isNestedIframe] = useState(
() => typeof window !== 'undefined'
&& new URLSearchParams(window.location.search).get('_iframe') === '1',
);
// The 404 page has no fixed pathname to match against (it renders for
// whatever bogus URL the user hit), so detect it via document.title
// instead. NOTE: a DOM marker (id) doesn't work here — in production,
Expand Down Expand Up @@ -495,6 +503,7 @@ const FloatingAssistant: React.FC = () => {
if (pageId === CUSTOM_PAGE_ID.API_PLAYGROUND) return null;
if (isTutorialsPage) return null;
if (isNotFoundPage) return null;
if (isNestedIframe) return null;

return (
<>
Expand Down
Loading