From ab3eb39618639dd29c5a0149c6c7088b56659751 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sun, 20 Mar 2022 17:47:03 +0600 Subject: [PATCH] Check the value of `localStorage.getItem` exists in the theme array --- src/helpers/utils.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/helpers/utils.jsx b/src/helpers/utils.jsx index e426a3f..a2a46c6 100644 --- a/src/helpers/utils.jsx +++ b/src/helpers/utils.jsx @@ -7,8 +7,12 @@ export const getInitialTheme = () => { return config.themeConfig.default; } - if (!(localStorage.getItem('gitprofile-theme') === null)) { + if ( + !(localStorage.getItem('gitprofile-theme') === null) && + config.themeConfig.themes.includes('gitprofile-theme') + ) { let theme = localStorage.getItem('gitprofile-theme'); + return theme; }