From 4f263fc7ec785f80add12316df914f8b1ebddd8e Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Wed, 9 Dec 2020 17:45:28 -0500 Subject: [PATCH] (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 --- app/client/ui/DocHistory.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/client/ui/DocHistory.ts b/app/client/ui/DocHistory.ts index 7e846b60..6eb4e109 100644 --- a/app/client/ui/DocHistory.ts +++ b/app/client/ui/DocHistory.ts @@ -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(owner, []);