11import type { AppMetadata , AuthenticateResponse , AutoQueryGridDefaults , UiConfig } from "@/types"
22import { ref , computed , type Component } from "vue"
3- import { LocalStore } from "./utils"
43import { getFormatters } from "./formatters"
54import { enumFlagsConverter } from "./metadata"
65import { createBus , toKebabCase } from "@servicestack/client"
@@ -23,6 +22,31 @@ export class Interceptors {
2322 }
2423}
2524
25+ /** SSR safe wrapper around localStorage */
26+ export class LocalStore implements Storage {
27+ get length ( ) { return typeof localStorage == "undefined" ? 0 : localStorage . length }
28+ getItem ( key :string ) {
29+ if ( typeof localStorage == "undefined" ) return null
30+ return localStorage . getItem ( key )
31+ }
32+ setItem ( key :string , value :string ) {
33+ if ( typeof localStorage == "undefined" ) return
34+ localStorage . setItem ( key , value )
35+ }
36+ removeItem ( key :string ) {
37+ if ( typeof localStorage == "undefined" ) return
38+ localStorage . removeItem ( key )
39+ }
40+ clear ( ) {
41+ if ( typeof localStorage == "undefined" ) return
42+ localStorage . clear ( )
43+ }
44+ key ( index : number ) {
45+ if ( typeof localStorage == "undefined" ) return null
46+ return localStorage . key ( index )
47+ }
48+ }
49+
2650export class Sole {
2751 static config :UiConfig = {
2852 redirectSignIn : '/signin' ,
0 commit comments