From 564b9e8ead3535efc5d5f12123169562fd3c3f83 Mon Sep 17 00:00:00 2001 From: vjrj Date: Sun, 18 Nov 2018 15:43:48 +0100 Subject: [PATCH] Trying to fix race condition in i18n load --- imports/ui/layouts/App/App.js | 116 +++++++++++++++++----------------- 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/imports/ui/layouts/App/App.js b/imports/ui/layouts/App/App.js index d991262..4aeef3a 100644 --- a/imports/ui/layouts/App/App.js +++ b/imports/ui/layouts/App/App.js @@ -98,66 +98,66 @@ const App = props => ( /* https://react.i18next.com/components/i18nextprovider.html */
{props.i18nReady.get() && - - - - - - { !props.loading && -
- - - {i18n.t('AppName')} - - - - - - + + + + + + { !props.loading && +
+ + + {i18n.t('AppName')} + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - -
- - - {props.i18nReady.get() && } -
} -
-
-
-
-
} + + + +
} +
+
+
+
+
}
); @@ -186,7 +186,9 @@ export default withTracker(() => { const loading = !Roles.subscription.ready() || !i18nReady.get(); const name = user && user.profile && user.profile.name && getUserName(user.profile.name); const emailAddress = user && user.emails && user.emails[0].address; - // console.log(`i18n ready?: ${i18nReady.get()}`); + Meteor.autorun(() => { + console.log(`i18n ready?: ${i18nReady.get()}`); + }); return { loading, loggingIn,