diff --git a/src/components/Framer/Framer.svelte b/src/components/Framer/Framer.svelte index 431a6314..45bcceef 100644 --- a/src/components/Framer/Framer.svelte +++ b/src/components/Framer/Framer.svelte @@ -23,6 +23,7 @@ }; let activeEmbed = getDefaultEmbed(); + let activeEmbedIndex = embeds.indexOf(activeEmbed); $: embedTitles = getUniqNames(embeds); @@ -30,11 +31,17 @@ let pymParent; const reframe = (embed) => { + // Bit of hack for handling adding query strings dynamically to embeds. + // cf. also the value prop on the Typeahead component... + const activeEmbed = + embeds.indexOf(embed) > -1 + ? embed + : embeds[activeEmbedIndex] || embeds[0]; pymParent = new pym.Parent( 'frame-parent', - /^http/.test(embed) - ? embed - : urljoin(window.location.origin, embed, { trailingSlash: true }) + /^http/.test(activeEmbed) + ? activeEmbed + : urljoin(window.location.origin, activeEmbed, { trailingSlash: true }) ); }; @@ -68,7 +75,9 @@ @@ -103,12 +113,9 @@ maxFrameWidth="{maxFrameWidth}" /> -