From e906bf58f07c808f9bd168f69b74ca1af88a7ff9 Mon Sep 17 00:00:00 2001 From: jonaswinkler <17569239+jonaswinkler@users.noreply.github.com> Date: Fri, 2 Apr 2021 14:46:45 +0200 Subject: [PATCH] Save list view state across sessions --- src-ui/src/app/services/document-list-view.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src-ui/src/app/services/document-list-view.service.ts b/src-ui/src/app/services/document-list-view.service.ts index 334706a3c..4745ffcea 100644 --- a/src-ui/src/app/services/document-list-view.service.ts +++ b/src-ui/src/app/services/document-list-view.service.ts @@ -197,7 +197,7 @@ export class DocumentListViewService { sortField: this.activeListViewState.sortField, sortReverse: this.activeListViewState.sortReverse } - sessionStorage.setItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG, JSON.stringify(savedState)) + localStorage.setItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG, JSON.stringify(savedState)) } } @@ -318,7 +318,7 @@ export class DocumentListViewService { } constructor(private documentService: DocumentService, private settings: SettingsService, private router: Router) { - let documentListViewConfigJson = sessionStorage.getItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG) + let documentListViewConfigJson = localStorage.getItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG) if (documentListViewConfigJson) { try { let savedState: ListViewState = JSON.parse(documentListViewConfigJson) @@ -332,7 +332,7 @@ export class DocumentListViewService { let newState = Object.assign(this.defaultListViewState(), savedState) this.listViewStates.set(null, newState) } catch (e) { - sessionStorage.removeItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG) + localStorage.removeItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG) } } }