Skip to content

Commit

Permalink
use location.origin in snippet url
Browse files Browse the repository at this point in the history
  • Loading branch information
interim17 committed Sep 30, 2024
1 parent f8873ef commit c25872d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/ShareTrajectoryModal/EmbedSnippetPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const EmbedSnippetPanel = ({ startTime }: EmbedSnippetPanelProps) => {
const [showEmbedSettingsPanel, setShowEmbedSettingsPanel] =
React.useState(false);

const url = `http://${location.host}/embed?trajFileName=${trajectory}&t=${startTime}}`;
const embedSnippet = `<iframe width="${width}" height="${height}" src="${url}" title="Simularium" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>`;
const url = `${location.origin}/embed?trajFileName=${trajectory}&t=${startTime}`;
const embedSnippet = `<iframe width="${width}" height="${height}" src="${url}" title="Simularium" allow="accelerometer; autoplay; clipboard-write; encrypted-media; frameBorder="0"; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>`;
const inputIsValid = (input: string) => {
return !Number.isNaN(parseInt(input));
};
Expand Down Expand Up @@ -100,7 +100,7 @@ const EmbedSnippetPanel = ({ startTime }: EmbedSnippetPanelProps) => {
/>
<span> x </span>
<Input
defaultValue={height}
value={height}
className={styles.numberInputs}
onChange={(e) => {
handleChangeHeight(e.target.value);
Expand Down

0 comments on commit c25872d

Please sign in to comment.