(
+ PersistedStorageKeys.USER_SETTINGS
+ )
+
+ if (persistedUserSettings) {
+ setSettings(persistedUserSettings)
+ } else {
+ await persistedStorage.setItem(
+ PersistedStorageKeys.USER_SETTINGS,
+ settings
+ )
+ }
+
+ setHasLoadedSettings(true)
+ })()
+ }, [hasLoadedSettings, persistedStorage, settings, userId])
return (
-
- {['/', '/index.html'].map(path => (
- } />
- ))}
- }
- />
-
+ {hasLoadedSettings ? (
+
+ {['/', '/index.html'].map(path => (
+ } />
+ ))}
+ }
+ />
+
+ ) : null}
)
}
diff --git a/src/models/settings.ts b/src/models/settings.ts
new file mode 100644
index 0000000..c9572f1
--- /dev/null
+++ b/src/models/settings.ts
@@ -0,0 +1,3 @@
+export interface UserSettings {
+ userId: string
+}
diff --git a/src/models/storage.ts b/src/models/storage.ts
new file mode 100644
index 0000000..8cce8f1
--- /dev/null
+++ b/src/models/storage.ts
@@ -0,0 +1,3 @@
+export enum PersistedStorageKeys {
+ USER_SETTINGS = 'userSettings',
+}