use sessionStorage instead of localStorage
This commit is contained in:
parent
e47d67a9da
commit
7f22040a0c
1 changed files with 5 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import { atom } from 'nanostores';
|
import { atom } from 'nanostores';
|
||||||
import { persistentAtom } from '@nanostores/persistent';
|
import { persistentAtom, setPersistentEngine } from '@nanostores/persistent';
|
||||||
import { useStore } from '@nanostores/react';
|
import { useStore } from '@nanostores/react';
|
||||||
import { logger } from '@strudel/core';
|
import { logger } from '@strudel/core';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
|
|
@ -21,6 +21,10 @@ export const patternFilterName = {
|
||||||
user: 'user',
|
user: 'user',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (typeof sessionStorage !== 'undefined') {
|
||||||
|
setPersistentEngine(sessionStorage);
|
||||||
|
}
|
||||||
|
|
||||||
export let $viewingPatternData = persistentAtom(
|
export let $viewingPatternData = persistentAtom(
|
||||||
'viewingPatternData',
|
'viewingPatternData',
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue