Skip to content

Commit

Permalink
Merge pull request #323 from oslokommune/develop
Browse files Browse the repository at this point in the history
small fixes before release v2.7.0
  • Loading branch information
aulonm authored Dec 29, 2021
2 parents f13ecbe + c36ae4b commit 82e7560
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,17 @@ export default {
hasInStorage() {
const mode = localStorage.getItem(this.LS_MODE);
return mode !== null;
return mode !== null && mode !== 'yellow';
},
setThemeMode(mode) {
this.saveThemeMode(mode);
this.setTheme(mode);
document.body.setAttribute('data-theme', mode);
},
getLocalThemeMode() {
return localStorage.getItem(this.LS_MODE);
},
saveThemeMode(mode) {
localStorage.setItem(this.LS_MODE, mode);
},
},
};
Expand Down
3 changes: 2 additions & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ export const getters = {
export const actions = {
...moduleActions,

setTheme: async ({ commit }, payload) => {
setTheme: async ({ state, commit }, payload) => {
commit('SET_THEME', payload);
localStorage.setItem(state.LS_MODE, payload);

return true;
},
Expand Down

0 comments on commit 82e7560

Please sign in to comment.