(core) Prevent stray 'compare' param from appearing in some snapshot links

Summary:
Some slight difference appeared, possibly during rebase, about including
compare parameters in URLs.

Test Plan: Browser test was failing, now passes

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2683
This commit is contained in:
Dmitry S 2020-12-09 17:45:28 -05:00
parent 92224084e4
commit 4f263fc7ec

View File

@ -59,7 +59,9 @@ export class DocHistory extends Disposable implements IDomComponent {
// We include urlState().state to preserve the currently selected page.
function setLink(snapshot: DocSnapshot, compareDocId?: string) {
return dom.attr('href', (use) => urlState().makeUrl({
...use(urlState().state), doc: snapshot.docId, params: {compare: compareDocId}}));
...use(urlState().state), doc: snapshot.docId,
params: (compareDocId ? {compare: compareDocId} : {})
}));
}
const snapshots = Observable.create<DocSnapshot[]>(owner, []);