From d2f0bbc521c99acd59df66f20fd36614f05c7552 Mon Sep 17 00:00:00 2001 From: Peter Banik Date: Mon, 13 Apr 2020 00:20:58 +0200 Subject: [PATCH] exchangeratebot initialization race fix --- frontend/src/features/app/appSlice.ts | 3 ++- frontend/src/index.tsx | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/src/features/app/appSlice.ts b/frontend/src/features/app/appSlice.ts index c81d0266..8b42fc85 100644 --- a/frontend/src/features/app/appSlice.ts +++ b/frontend/src/features/app/appSlice.ts @@ -139,7 +139,8 @@ export const launchApp: ActionCreator = () => { // default flag. // @FIXME add GUI to select default endpoint await store.dispatch(connectDefaultWallet()) - await store.dispatch(subscribeExchangeRateFeed()) + await store.dispatch(subscribeExchangeRateFeed()) + w.walletgui_onAppOpen() } } diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 2abb8281..2e0e6698 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -23,12 +23,9 @@ ReactDOM.render( // @TODO pass down a flag to identify dev/production mode and // enable the below function to disable the context menu in production // builds. -const w = window as any +const w = (window as any) w.document.addEventListener("contextmenu", function (e: any) { // e.preventDefault(); }) store.dispatch(launchApp()) - .then(() => { - w.walletgui_onAppOpen() - })