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("<")) {
1616
1717initializeApp ( config )
1818
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+ } )
2226
2327const isNavigraphClient = config . clientId . includes ( "navigraph" )
2428const clientPrefix = isNavigraphClient ? "NG" : config . clientId . toUpperCase ( ) . replace ( "-" , "_" ) + "_NG"
You can’t perform that action at this time.
0 commit comments