Skip to content

Commit f0d1e75

Browse files
authored
Merge pull request #3977 from Emurgo/fix/connector-i18n
fix i18n for connector pop up
2 parents 881d046 + 758dce2 commit f0d1e75

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

packages/yoroi-extension/app/connector/stores/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function initializeSubstore<T: {...}>(
7070
export default (action(
7171
(
7272
api: Api,
73-
): StoresMap => {
73+
): Promise<StoresMap> => {
7474
const storeNames = Object.keys(storeClasses);
7575
storeNames.forEach(name => {
7676
if (stores[name]) stores[name].teardown();
@@ -94,13 +94,14 @@ export default (action(
9494
initializeSubstore<AdaStoresMap>(loadedStores.substores.ada);
9595

9696
// Perform load after all setup is done to ensure migration can modify store state
97-
loadedStores.loading.load()
97+
return loadedStores.loading.load()
9898
.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+
});
102103
}
103-
): (Api) => StoresMap);
104+
): (Api) => Promise<StoresMap>);
104105

105106
export type ConnectorStoresProps = {|
106107
+stores: StoresMap,

packages/yoroi-extension/app/connector/stores/toplevel/ProfileStore.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ export default class ProfileStore extends BaseProfileStore<StoresMap> {
88

99
setup(): void {
1010
super.setup();
11+
this.stores.loading.registerBlockingLoadingRequest(
12+
(async () => {
13+
await this.getProfileLocaleRequest.execute();
14+
})(),
15+
'load locale'
16+
);
1117
}
1218

1319
teardown(): void {

packages/yoroi-extension/chrome/extension/connector/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const initializeDappConnector: void => Promise<void> = async () => {
2929
const router = new RouterStore();
3030
const hashHistory = createHashHistory();
3131
const history = syncHistoryWithStore(hashHistory, router);
32-
const stores = createStores(api);
32+
const stores = await createStores(api);
3333

3434
window.yoroi = {
3535
api,

0 commit comments

Comments
 (0)