File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,13 @@ if (!config.clientId || config.clientId.includes("<")) {
16
16
17
17
initializeApp ( config )
18
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 ) )
19
+ // Wait for DataStorage ready event before initializing SDK
20
+ const dataStoreInit = new Promise < void > ( res => {
21
+ const lis = RegisterViewListener ( "JS_LISTENER_DATASTORAGE" , ( ) => {
22
+ res ( )
23
+ lis . unregister ( )
24
+ } )
25
+ } )
22
26
23
27
const isNavigraphClient = config . clientId . includes ( "navigraph" )
24
28
const clientPrefix = isNavigraphClient ? "NG" : config . clientId . toUpperCase ( ) . replace ( "-" , "_" ) + "_NG"
You can’t perform that action at this time.
0 commit comments