We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7c4fff commit af7c325Copy full SHA for af7c325
examples/gauge/Lib/navigraph.ts
@@ -16,9 +16,13 @@ if (!config.clientId || config.clientId.includes("<")) {
16
17
initializeApp(config)
18
19
-// Wait 1s before accessing datastorage
20
-// This is a potential workaround for the issue where datastorage does not deliver credentials on startup.
21
-const dataStoreInit = new Promise(resolve => setTimeout(resolve, 1000))
+// Wait for DataStorage ready event before initializing SDK
+const dataStoreInit = new Promise<void>(res => {
+ const lis = RegisterViewListener("JS_LISTENER_DATASTORAGE", () => {
22
+ res()
23
+ lis.unregister()
24
+ })
25
+})
26
27
const isNavigraphClient = config.clientId.includes("navigraph")
28
const clientPrefix = isNavigraphClient ? "NG" : config.clientId.toUpperCase().replace("-", "_") + "_NG"
0 commit comments