Save filter fix (#2022)

This commit is contained in:
Denis Bykhov 2022-06-07 14:55:11 +06:00 committed by GitHub
parent d1bd356f64
commit 7552aca955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,6 +72,8 @@
function saveFilters (filters: Filter[]) {
const loc = getCurrentLocation()
loc.fragment = undefined
loc.query = undefined
const key = 'filter' + locationToUrl(loc)
if (filters.length > 0) {
localStorage.setItem(key, JSON.stringify(filters))
@ -82,6 +84,8 @@
function load (_class: Ref<Class<Doc>>) {
const loc = getCurrentLocation()
loc.fragment = undefined
loc.query = undefined
const key = 'filter' + locationToUrl(loc)
const saved = localStorage.getItem(key)
filters.map((p) => p.onRemove?.())