Skip to content

Commit

Permalink
fix: i18n dispatcher
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Sep 12, 2024
1 parent fb3b592 commit c038c79
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/renderer/src/providers/i18n-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const langChangedHandler = async (lang: string) => {
const loaded = i18next.getResourceBundle(lang, defaultNS)

if (loaded) {
EventBus.dispatch("I18N_UPDATE", lang)
return
}

Expand Down Expand Up @@ -77,13 +76,9 @@ export const I18nProvider: FC<PropsWithChildren> = ({ children }) => {
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/rules-of-hooks
useEffect(
() =>
EventBus.subscribe("I18N_UPDATE", (lang) => {
EventBus.subscribe("I18N_UPDATE", () => {
nextFrame(() => {
update(
i18next.cloneInstance({
lng: lang,
}),
)
update(i18next.cloneInstance())
})
}),
[update],
Expand Down

0 comments on commit c038c79

Please sign in to comment.