From 9b9916e3244403252c0983d9445aab4d3085bd84 Mon Sep 17 00:00:00 2001 From: Paul Nta Date: Tue, 6 Apr 2021 20:41:07 +0200 Subject: [PATCH 1/2] fix: cancel preview updates while reloading --- src/toolbar/preview/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/toolbar/preview/index.js b/src/toolbar/preview/index.js index 6fc6b11..1ff5dcb 100644 --- a/src/toolbar/preview/index.js +++ b/src/toolbar/preview/index.js @@ -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 From ac7be8bedfa8689382ea55593bdd453e98a931ee Mon Sep 17 00:00:00 2001 From: Paul Nta Date: Tue, 6 Apr 2021 20:42:47 +0200 Subject: [PATCH 2/2] chore: bump to 4.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a8c5b08..1eb6f5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prismic-toolbar", - "version": "4.0.4", + "version": "4.0.5", "description": "Prismic Toolbar", "license": "Apache-2.0", "main": "build/prismic-toolbar.js",