(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
This commit is contained in:
Dmitry S 2020-12-11 14:04:06 -05:00
parent b3a57e3b5c
commit e5d41c72dc

View File

@ -67,7 +67,8 @@ export class DocHistory extends Disposable implements IDomComponent {
const snapshots = Observable.create<DocSnapshot[]>(owner, []); const snapshots = Observable.create<DocSnapshot[]>(owner, []);
const userApi = this._docPageModel.appModel.api; const userApi = this._docPageModel.appModel.api;
const docApi = userApi.getDocAPI(origUrlId); 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', return dom('div',
// Note that most recent snapshots are first. // Note that most recent snapshots are first.
dom.domComputed(snapshots, (snapshotList) => snapshotList.map((snapshot, index) => { dom.domComputed(snapshots, (snapshotList) => snapshotList.map((snapshot, index) => {