From e5d41c72dcc5e7a62249e497cad5529382a95a65 Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Fri, 11 Dec 2020 14:04:06 -0500 Subject: [PATCH] (core) Fix JS error when switching from DocHistory to ActionLog too quickly. Summary: Also added a Chrome option to tests to suppress popup to save passwords, and unified setting of Chrome options in one shared file. Test Plan: Tested locally, reproduced the problem by adding a delay in BaseAPI. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2687 --- app/client/ui/DocHistory.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/client/ui/DocHistory.ts b/app/client/ui/DocHistory.ts index 6eb4e109..fe6a2b9e 100644 --- a/app/client/ui/DocHistory.ts +++ b/app/client/ui/DocHistory.ts @@ -67,7 +67,8 @@ export class DocHistory extends Disposable implements IDomComponent { const snapshots = Observable.create(owner, []); const userApi = this._docPageModel.appModel.api; const docApi = userApi.getDocAPI(origUrlId); - docApi.getSnapshots().then(result => snapshots.set(result.snapshots)).catch(reportError); + docApi.getSnapshots().then(result => + snapshots.isDisposed() || snapshots.set(result.snapshots)).catch(reportError); return dom('div', // Note that most recent snapshots are first. dom.domComputed(snapshots, (snapshotList) => snapshotList.map((snapshot, index) => {