From 97cb8065d9c76422f0a499155c265b4f955eb47a Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Fri, 20 Aug 2021 17:04:18 +0200 Subject: [PATCH] (core) Open links with different link keys in a new tab Summary: Check urlState.params.linkParameters in needPageLoad Test Plan: Added case to nbrowser test, tested manually Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2984 --- app/client/models/gristUrlState.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/client/models/gristUrlState.ts b/app/client/models/gristUrlState.ts index 44e810aa..33a4c6cb 100644 --- a/app/client/models/gristUrlState.ts +++ b/app/client/models/gristUrlState.ts @@ -27,6 +27,7 @@ import {UrlState} from 'app/client/lib/UrlState'; import {decodeUrl, encodeUrl, getSlugIfNeeded, GristLoadConfig, IGristUrlState, useNewUI} from 'app/common/gristUrls'; import {Document} from 'app/common/UserAPI'; import isEmpty = require('lodash/isEmpty'); +import isEqual = require('lodash/isEqual'); import {CellValue} from "app/plugin/GristData"; /** @@ -166,7 +167,10 @@ export class UrlStateImpl { const newuiReload = useNewUI(prevState.newui) !== useNewUI(newState.newui); // Reload when moving to/from a welcome page. const welcomeReload = Boolean(prevState.welcome) !== Boolean(newState.welcome); - return Boolean(orgReload || billingReload || gristConfig.errPage || docReload || newuiReload || welcomeReload); + // Reload when link keys change, which changes what the user can access + const linkKeysReload = !isEqual(prevState.params?.linkParameters, newState.params?.linkParameters); + return Boolean(orgReload || billingReload || gristConfig.errPage + || docReload || newuiReload || welcomeReload || linkKeysReload); } /**