From d7768adea2e57ff520a63bdf2a9bd08fbafb6542 Mon Sep 17 00:00:00 2001 From: Nikolay Chunosov Date: Wed, 25 Dec 2024 13:11:07 +0700 Subject: [PATCH] load view options from old key when there is no new one Signed-off-by: Nikolay Chunosov --- plugins/view-resources/src/viewOptions.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/view-resources/src/viewOptions.ts b/plugins/view-resources/src/viewOptions.ts index dec09cddbb..66855b0530 100644 --- a/plugins/view-resources/src/viewOptions.ts +++ b/plugins/view-resources/src/viewOptions.ts @@ -31,8 +31,11 @@ export function isDropdownType (viewOption: ViewOptionModel): viewOption is Drop return viewOption.type === 'dropdown' } -function makeViewOptionsKey (viewlet: Viewlet, variant?: string): string { - const prefix = viewlet.viewOptions?.storageKey ?? viewlet._id + (variant !== undefined ? `-${variant}` : '') +function makeViewOptionsKey (viewlet: Viewlet, variant?: string, ignoreViewletKey = false): string { + const prefix = + viewlet.viewOptions?.storageKey !== undefined && !ignoreViewletKey + ? viewlet.viewOptions.storageKey + : viewlet._id + (variant !== undefined ? `-${variant}` : '') const loc = getCurrentResolvedLocation() loc.fragment = undefined loc.query = undefined @@ -57,8 +60,14 @@ function _getViewOptions (viewlet: Viewlet, viewOptionStore: Map