Skip to content

Commit

Permalink
#8219: improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
twschiller committed Apr 11, 2024
1 parent e1775b5 commit 62355cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/contentScript/contentScriptCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ export async function init(): Promise<void> {
void initSidebarActivation();

if (!isLoadedInIframe()) {
// FIXME: do we want to do this? It will cause the panels to be reset on non-SPA navigation/reload
// Update `sidePanel`
// TODO: https://github.com/pixiebrix/pixiebrix-extension/issues/8209
// Reset panels in `sidePanel` on content script initialization (which happens on non-SPA reload/navigation).
// That's the safe behavior for now to avoid showing stale data/invalid forms.
// Re-examine this call when we implement: https://www.notion.so/pixiebrix/0efdedb6c1e44b088e65106202e08c28
void renderPanelsIfVisible();
}

Expand Down
5 changes: 4 additions & 1 deletion src/contentScript/sidebarController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@ export async function renderPanelsIfVisible(): Promise<void> {
expectContext("contentScript");

if (isLoadedInIframe()) {
console.warn("renderPanelsIfVisible should not be called from a frame");
// The top-level frame is responsible for managing the panels for the sidebar
console.warn(
"sidebarController:renderPanelsIfVisible should not be called from a frame",
);
return;
}

Expand Down

0 comments on commit 62355cf

Please sign in to comment.