File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed
Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -117,15 +117,3 @@ export default class FormSelections {
117117 twitter = new TwitterSelections ( ) ;
118118 wiki = new WikiSelections ( ) ;
119119}
120-
121- export function getFormSelections ( ) {
122- try {
123- if ( sessionStorage . getItem ( 'form' ) ) {
124- return JSON . parse ( sessionStorage . getItem ( 'form' ) ! ) as FormSelections ;
125- }
126- return new FormSelections ( ) ;
127- } catch {
128- sessionStorage . removeItem ( 'form' ) ;
129- return new FormSelections ( ) ;
130- }
131- }
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { get, writable } from 'svelte/store';
22import { NavMode } from './components/chartUtils' ;
33import DataSet , { DataGroup } from './data/DataSet' ;
44import deriveLinkDefaults , { getDirectLinkImpl } from './deriveLinkDefaults' ;
5- import { getFormSelections } from './components/dialogs/formSelections' ;
5+ import FormSelections from './components/dialogs/formSelections' ;
66
77declare const __VERSION__ : string ;
88
@@ -18,6 +18,18 @@ export const isShowingPoints = writable(defaults.showPoints);
1818export const initialViewport = writable ( defaults . viewport ) ;
1919export const navMode = writable ( NavMode . autofit ) ;
2020
21+ export function getFormSelections ( ) {
22+ try {
23+ if ( sessionStorage . getItem ( 'form' ) ) {
24+ return JSON . parse ( sessionStorage . getItem ( 'form' ) ! ) as FormSelections ;
25+ }
26+ return new FormSelections ( ) ;
27+ } catch {
28+ sessionStorage . removeItem ( 'form' ) ;
29+ return new FormSelections ( ) ;
30+ }
31+ }
32+
2133export const formSelections = writable ( getFormSelections ( ) ) ;
2234formSelections . subscribe ( ( val ) => {
2335 sessionStorage . setItem ( 'form' , JSON . stringify ( val ) ) ;
You can’t perform that action at this time.
0 commit comments