Skip to content

fix i18n for connector pop up #3977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions packages/yoroi-extension/app/connector/stores/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function initializeSubstore<T: {...}>(
export default (action(
(
api: Api,
): StoresMap => {
): Promise<StoresMap> => {
const storeNames = Object.keys(storeClasses);
storeNames.forEach(name => {
if (stores[name]) stores[name].teardown();
Expand All @@ -94,13 +94,14 @@ export default (action(
initializeSubstore<AdaStoresMap>(loadedStores.substores.ada);

// Perform load after all setup is done to ensure migration can modify store state
loadedStores.loading.load()
return loadedStores.loading.load()
.then(() => console.debug('connector / loading store loaded'))
.catch(e => console.error('connector / loading store load failed', e));

return loadedStores;
.catch(e => console.error('connector / loading store load failed', e))
.then(() => {
return loadedStores;
});
Comment on lines +100 to +102
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better return after console.log on the first then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aatsindev , thanks for reviewing! Could you please help make a commit to this branch? Thanks.

}
): (Api) => StoresMap);
): (Api) => Promise<StoresMap>);

export type ConnectorStoresProps = {|
+stores: StoresMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export default class ProfileStore extends BaseProfileStore<StoresMap> {

setup(): void {
super.setup();
this.stores.loading.registerBlockingLoadingRequest(
(async () => {
await this.getProfileLocaleRequest.execute();
})(),
'load locale'
);
}

teardown(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const initializeDappConnector: void => Promise<void> = async () => {
const router = new RouterStore();
const hashHistory = createHashHistory();
const history = syncHistoryWithStore(hashHistory, router);
const stores = createStores(api);
const stores = await createStores(api);

window.yoroi = {
api,
Expand Down