From e332d995fce6a6bd513e7121f659347e16cbc209 Mon Sep 17 00:00:00 2001 From: Florent Date: Mon, 9 Sep 2024 14:33:23 +0200 Subject: [PATCH] fix: storybook issue on story change --- bun.lockb | Bin 2017778 -> 2017778 bytes web-storybook/.storybook/preview.jsx | 16 ++++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bun.lockb b/bun.lockb index 780b016f4b8eaa2aeb17da6ba5bd53a46ea40955..577a121a6c7759bdfa994124a100e19e1be17d96 100755 GIT binary patch delta 127 zcmew~x%$)O>V_7^7N!>F7M2#)7Pc1l7LFFq7OocV7M>Q~7QPn#7J(MQ7NHj57LhHY z?H-DZaVC0(dd3V4+a;M8I2jlkIy|^)?nvecD?w%2S9pj5u^14G1F-}UO9HVJ5K9BG O3=qq1U*RF=)d&C(pD5`7 delta 127 zcmew~x%$)O>V_7^7N!>F7M2#)7Pc1l7LFFq7OocV7M>Q~7QPn#7J(MQ7NHj57LhHY z?H-Cu3{bFLl8J$nfuW(pgRAC_WR9>BRHl7}hbRz>0kJp`O8~JX5K95EG!V-GvF!F0 I9&%od0ClV;M*si- diff --git a/web-storybook/.storybook/preview.jsx b/web-storybook/.storybook/preview.jsx index f39ab74151..41f3df811d 100644 --- a/web-storybook/.storybook/preview.jsx +++ b/web-storybook/.storybook/preview.jsx @@ -13,13 +13,17 @@ import '../../tailwind.css'; window.Buffer = Buffer; const StorybookI18nProvider = ({ children }) => { - useEffect(async () => { - const { messages } = await import( - `web-marketplace/src/lib/i18n/locales/en.po` - ); + useEffect(() => { + const loadTranslations = async () => { + const { messages } = await import( + `web-marketplace/src/lib/i18n/locales/en.po` + ); - i18n.load('en', messages); - i18n.activate('en'); + i18n.load('en', messages); + i18n.activate('en'); + }; + + loadTranslations(); }, []); return {children};