Check the value of localStorage.getItem exists in the theme array

This commit is contained in:
Ariful Alam 2022-03-20 17:47:03 +06:00
parent f711238d73
commit ab3eb39618

View File

@ -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;
}