Rename key of localStorage's property
This commit is contained in:
parent
2ded9a0625
commit
23f07cc8ef
@ -12,7 +12,7 @@ const ThemeChanger = () => {
|
||||
const changeTheme = (e, selectedTheme) => {
|
||||
e.preventDefault();
|
||||
document.querySelector('html').setAttribute('data-theme', selectedTheme);
|
||||
localStorage.setItem('ezprofileTheme', selectedTheme);
|
||||
localStorage.setItem('ezprofile-theme', selectedTheme);
|
||||
|
||||
setTheme(selectedTheme);
|
||||
}
|
||||
|
||||
@ -7,8 +7,8 @@ export const getInitialTheme = () => {
|
||||
return config.themeConfig.default;
|
||||
}
|
||||
|
||||
if (localStorage.hasOwnProperty('ezprofileTheme')) {
|
||||
let theme = localStorage.getItem('ezprofileTheme');
|
||||
if (localStorage.hasOwnProperty('ezprofile-theme')) {
|
||||
let theme = localStorage.getItem('ezprofile-theme');
|
||||
return theme;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user