Merge pull request #38 from arifszn/close-37

feat: check the value of `localStorage.getItem` exists in the theme array
This commit is contained in:
Ariful Alam 2022-03-20 17:49:50 +06:00 committed by GitHub
commit adc5fc857f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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