Skip to content

Commit

Permalink
fix: fix disableCssAnimation bug when using multiple viewports
Browse files Browse the repository at this point in the history
  • Loading branch information
wadackel committed Jun 18, 2022
1 parent ada0d97 commit 1091863
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/storycap/src/node/capturing-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ export class CapturingBrowser extends StoryPreviewBrowser {
Object.entries(exposed).forEach(([k, f]) => this.page.exposeFunction(k, f));
}

private async reload() {
await this.page.reload();
await this.addStyles();
}

private async waitIfTouched() {
if (!this.touched) return;
await sleep(this.opt.stateChangeDelay);
Expand Down Expand Up @@ -255,7 +260,7 @@ export class CapturingBrowser extends StoryPreviewBrowser {
this.viewport = nextViewport;
if (willBeReloaded || this.opt.reloadAfterChangeViewport) {
this.processedStories.delete(this.currentRequestId);
await Promise.all([this.page.reload(), this.waitForOptionsFromBrowser()]);
await Promise.all([this.reload(), this.waitForOptionsFromBrowser()]);
} else {
await sleep(this.opt.viewportDelay);
}
Expand Down

0 comments on commit 1091863

Please sign in to comment.