mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 21:15:06 +02:00
save login token to localstorage
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
@@ -56,6 +56,8 @@ export { default as IconSearch } from './components/icons/Search.svelte'
|
||||
export { default as IconToDo } from './components/icons/ToDo.svelte'
|
||||
export { default as IconComments } from './components/icons/Comments.svelte'
|
||||
|
||||
export * from './utils'
|
||||
|
||||
import type { AnySvelteComponent, AnyComponent } from './types'
|
||||
import { writable } from 'svelte/store'
|
||||
|
||||
|
||||
@@ -14,7 +14,21 @@
|
||||
//
|
||||
|
||||
// import type { Metadata } from '@anticrm/platform'
|
||||
import type { AnyComponent /*, Location */ } from './types'
|
||||
import { setMetadata } from '@anticrm/platform'
|
||||
import type { Metadata } from '@anticrm/platform'
|
||||
|
||||
export function setMetadataLocalStorage(id: Metadata<string>, value: string): void {
|
||||
localStorage.setItem(id, value)
|
||||
setMetadata(id, value)
|
||||
}
|
||||
|
||||
export function fetchMetadataLocalStorage(id: Metadata<string>): string | null {
|
||||
const value = localStorage.getItem(id)
|
||||
if (value !== null) {
|
||||
setMetadata(id, value)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
// import { Readable, derived, writable } from 'svelte/store'
|
||||
// import { onDestroy, getContext, setContext } from 'svelte'
|
||||
|
||||
Reference in New Issue
Block a user