Skip to content
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

fix: never render HeaderBar without runtime provider #587

Merged
merged 5 commits into from
Jul 8, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: log locale initialization in useEffect, add emoji to log
  • Loading branch information
amcgee committed Jul 8, 2021
commit b1bf69d5d468fd0279bedec28d534f7b9a4be9ac
7 changes: 3 additions & 4 deletions adapter/src/utils/useLocale.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ export const useLocale = locale => {
if (!locale) {
return
}

setGlobalLocale(locale)
setResult(locale)

console.log('🗺 Global d2-i18n locale initialized:', locale)
}, [locale])
return result
}
Expand All @@ -55,9 +58,5 @@ export const useCurrentUserLocale = () => {
throw new Error('Failed to fetch user locale: ' + error)
}

if (locale) {
console.log('d2-i18n locale initialized', locale)
}

return { loading: loading || !locale, locale }
}