From 8b1152fac1722952dc8b9fb18aeea4fd022f5d46 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Fri, 26 Oct 2018 22:50:58 +0900 Subject: [PATCH] Remove unnecesary state to fix preference's menu --- src/renderer/components/GlobalHeader.vue | 2 +- src/renderer/components/Preferences.vue | 32 ++++++------------- .../components/Preferences/Account.vue | 1 - src/renderer/store/Preferences.js | 10 ++---- 4 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/renderer/components/GlobalHeader.vue b/src/renderer/components/GlobalHeader.vue index f1c3247a..400c0c69 100644 --- a/src/renderer/components/GlobalHeader.vue +++ b/src/renderer/components/GlobalHeader.vue @@ -3,7 +3,7 @@ - + :router="true"> + {{ $t('preferences.general.title') }} - + {{ $t('preferences.appearance.title') }} - + {{ $t('preferences.notification.title') }} - + {{ $t('preferences.account.title') }} - + {{ $t('preferences.language.title') }} @@ -55,7 +55,6 @@ export default { name: 'preferences', computed: { ...mapState({ - defaultActive: state => state.Preferences.defaultActive, primaryColor: state => state.App.theme.primary_color, backgroundColor: state => state.App.theme.background_color }) @@ -63,22 +62,9 @@ export default { methods: { close () { this.$router.push('/') - this.$store.commit('Preferences/changeActive', '1') }, - general () { - this.$router.push('/preferences/general') - }, - notification () { - this.$router.push('/preferences/notification') - }, - account () { - this.$router.push('/preferences/account') - }, - language () { - this.$router.push('/preferences/language') - }, - appearance () { - this.$router.push('/preferences/appearance') + activeRoute () { + return this.$route.path } } } diff --git a/src/renderer/components/Preferences/Account.vue b/src/renderer/components/Preferences/Account.vue index 0ea12585..45e5f33a 100644 --- a/src/renderer/components/Preferences/Account.vue +++ b/src/renderer/components/Preferences/Account.vue @@ -77,7 +77,6 @@ export default { }) }, created () { - this.$store.commit('Preferences/changeActive', '2') this.loadAccounts() }, methods: { diff --git a/src/renderer/store/Preferences.js b/src/renderer/store/Preferences.js index a523cbaa..b1ffa9d8 100644 --- a/src/renderer/store/Preferences.js +++ b/src/renderer/store/Preferences.js @@ -13,14 +13,8 @@ const Preferences = { Notification, Appearance }, - state: { - defaultActive: '1' - }, - mutations: { - changeActive (state, value) { - state.defaultActive = value - } - } + state: {}, + mutations: {} } export default Preferences