File tree 3 files changed +14
-7
lines changed
chrome/extension/connector
3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ function initializeSubstore<T: {...}>(
70
70
export default (action(
71
71
(
72
72
api: Api,
73
- ): StoresMap => {
73
+ ): Promise < StoresMap > => {
74
74
const storeNames = Object . keys ( storeClasses ) ;
75
75
storeNames . forEach ( name => {
76
76
if ( stores [ name ] ) stores [ name ] . teardown ( ) ;
@@ -94,13 +94,14 @@ export default (action(
94
94
initializeSubstore < AdaStoresMap > ( loadedStores . substores . ada ) ;
95
95
96
96
// Perform load after all setup is done to ensure migration can modify store state
97
- loadedStores . loading . load ( )
97
+ return loadedStores . loading . load ( )
98
98
. then ( ( ) => console . debug ( 'connector / loading store loaded' ) )
99
- . catch ( e => console . error ( 'connector / loading store load failed' , e ) ) ;
100
-
101
- return loadedStores ;
99
+ . catch ( e => console . error ( 'connector / loading store load failed' , e ) )
100
+ . then ( ( ) => {
101
+ return loadedStores ;
102
+ } ) ;
102
103
}
103
- ): (Api) => StoresMap ) ;
104
+ ): (Api) => Promise < StoresMap > );
104
105
105
106
export type ConnectorStoresProps = { |
106
107
+ stores : StoresMap ,
Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ export default class ProfileStore extends BaseProfileStore<StoresMap> {
8
8
9
9
setup ( ) : void {
10
10
super. setup ( ) ;
11
+ this . stores . loading . registerBlockingLoadingRequest (
12
+ ( async ( ) => {
13
+ await this . getProfileLocaleRequest . execute ( ) ;
14
+ } ) ( ) ,
15
+ 'load locale'
16
+ ) ;
11
17
}
12
18
13
19
teardown ( ) : void {
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ const initializeDappConnector: void => Promise<void> = async () => {
29
29
const router = new RouterStore ( ) ;
30
30
const hashHistory = createHashHistory ( ) ;
31
31
const history = syncHistoryWithStore ( hashHistory , router ) ;
32
- const stores = createStores ( api ) ;
32
+ const stores = await createStores ( api ) ;
33
33
34
34
window . yoroi = {
35
35
api,
You can’t perform that action at this time.
0 commit comments