From fa2a389686a08d6040267ddd02cffc4560b86b2c Mon Sep 17 00:00:00 2001 From: developomp Date: Sat, 26 Mar 2022 21:20:09 +0900 Subject: [PATCH] bug fix - fixed a bug where the content loading logic fails when there's no translatd page --- src/pages/Page/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/Page/index.tsx b/src/pages/Page/index.tsx index f9acdc6..0c6bea5 100644 --- a/src/pages/Page/index.tsx +++ b/src/pages/Page/index.tsx @@ -67,7 +67,11 @@ const fetchContent = async ( if (locale == "en") { return await import(`../../data/content${url}.json`) } else { - return await import(`../../data/content${url}.${locale}.json`) + try { + return await import(`../../data/content${url}.${locale}.json`) + } catch { + return await import(`../../data/content${url}.json`) + } } } catch (err) { return