diff options
author | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2020-04-30 12:09:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-30 12:09:12 +0300 |
commit | 740903e8838a044f5c548be7f4982da861b1f03d (patch) | |
tree | 69579ed26d9082619b74f598c7d85af46523a965 /src | |
parent | 82b396199261fb67cdc523e4eecf95510a25f1c4 (diff) | |
parent | 6ae02d256603904fe203b4410a4ba0dcd1c705cb (diff) |
Merge pull request #996 from nextcloud/fix/noid/initial-route
Only save initial route on change
Diffstat (limited to 'src')
-rw-r--r-- | src/components/AppNavigation/List.vue | 4 | ||||
-rw-r--r-- | src/store/settings.js | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/components/AppNavigation/List.vue b/src/components/AppNavigation/List.vue index 172256ae..ec407f5b 100644 --- a/src/components/AppNavigation/List.vue +++ b/src/components/AppNavigation/List.vue @@ -138,6 +138,7 @@ export default { calendarCount: 'getCalendarCount', isCalendarNameUsed: 'isCalendarNameUsed', getTask: 'getTaskByUri', + initialRoute: 'initialRoute', }), }, methods: { @@ -326,6 +327,9 @@ export default { * @param {String} route The new initial route */ setInitialRoute(route) { + if (route === this.initialRoute) { + return + } this.setSetting({ type: 'initialRoute', value: route }) }, }, diff --git a/src/store/settings.js b/src/store/settings.js index 15779a3d..b5f00ca3 100644 --- a/src/store/settings.js +++ b/src/store/settings.js @@ -58,6 +58,14 @@ const getters = { * @returns {String} Whether all-day is default */ allDay: (state) => state.settings.allDay, + + /** + * Returns the initial route + * + * @param {Object} state The store data + * @returns {String} Whether all-day is default + */ + initialRoute: (state) => state.settings.initialRoute, } const mutations = { @@ -109,6 +117,7 @@ const actions = { sortOrder: loadState('tasks', 'sortOrder'), sortDirection: loadState('tasks', 'sortDirection'), allDay: loadState('tasks', 'allDay'), + initialRoute: loadState('tasks', 'initialRoute'), }) }, } |