Skip to content

Commit

Permalink
fix: reset iframe if bootstrap had failed before rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
fwouts committed Sep 23, 2023
1 parent 0bef383 commit 1111863
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion iframe/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ class PreviewIframeControllerImpl implements PreviewIframeController {
async render(previewableId: string, options: RenderOptions) {
const previousRender = this.lastRender;
this.lastRender = { previewableId, options };
if (previousRender?.previewableId !== previewableId) {
if (
previousRender?.previewableId !== previewableId ||
this.bootstrapStatus === "failure"
) {
this.resetIframe(previewableId);
return;
}
Expand Down

0 comments on commit 1111863

Please sign in to comment.