Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite refresh loop during previews #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prismic-toolbar",
"version": "4.0.4",
"version": "4.0.5",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I'm supposed to change this version manually. Also there is a different version in package.lock

"version": "4.0.2",

"description": "Prismic Toolbar",
"license": "Apache-2.0",
"main": "build/prismic-toolbar.js",
Expand Down
5 changes: 4 additions & 1 deletion src/toolbar/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export class Preview {
async updatePreview() {
const { reload, ref } = await this.client.updatePreview();
this.start(ref);
if (reload) { reloadOrigin(); }
if (reload) {
this.cancelPreviewUpdates();
reloadOrigin();
}
}

// Start preview
Expand Down