Skip to content

Commit

Permalink
Fix 'post:' origin (#198)
Browse files Browse the repository at this point in the history
Co-authored-by: Yan Chen <[email protected]>
  • Loading branch information
rvanasa and chenyan-dfinity authored Sep 13, 2023
1 parent 5ee2b64 commit 9c01170
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ async function fetchFromUrlParams(
if (editorKey) {
const result = await setupEditorIntegration(editorKey, dispatch, worker);
if (result) {
const { origin, files } = result;
await dispatch({
type: "setOrigin",
payload: { origin: "playground", tags: [`post:${origin}`] },
});
const { files } = result;
return files;
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/integrations/editorIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ type EditorIntegrationResponse = {
};

export interface EditorIntegrationResult {
origin: string;
files: Record<string, string>;
}

Expand Down Expand Up @@ -106,6 +105,11 @@ export async function setupEditorIntegration(
});
}
}

await dispatch({
type: "setOrigin",
payload: { origin: "playground", tags: [`post:${origin}`] },
});
} catch (e) {
console.error("Error in editor integration message listener:");
console.error(e);
Expand All @@ -116,7 +120,6 @@ export async function setupEditorIntegration(

// Load a default empty project
previousResult = {
origin,
files: {
"Main.mo": "",
},
Expand Down

0 comments on commit 9c01170

Please sign in to comment.