mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 05:55:09 +02:00
Tracker: Refactor ViewOptions (#2228)
Signed-off-by: Dvinyanin Alexandr <dvinyanin.alexandr@gmail.com>
This commit is contained in:
@@ -431,24 +431,3 @@ export function getActiveViewletId (): Ref<Viewlet> | null {
|
||||
const key = makeViewletKey()
|
||||
return localStorage.getItem(key) as Ref<Viewlet> | null
|
||||
}
|
||||
|
||||
function makeViewOptionsKey (viewletId: Ref<Viewlet>): string {
|
||||
const loc = getCurrentLocation()
|
||||
loc.fragment = undefined
|
||||
loc.query = undefined
|
||||
return `viewOptions:${viewletId}:${locationToUrl(loc)}`
|
||||
}
|
||||
|
||||
export function setViewOptions (viewletId: Ref<Viewlet>, options: string | null): void {
|
||||
const key = makeViewOptionsKey(viewletId)
|
||||
if (options !== null) {
|
||||
localStorage.setItem(key, options)
|
||||
} else {
|
||||
localStorage.removeItem(key)
|
||||
}
|
||||
}
|
||||
|
||||
export function getViewOptions (viewletId: Ref<Viewlet>): string | null {
|
||||
const key = makeViewOptionsKey(viewletId)
|
||||
return localStorage.getItem(key)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user