diff --git a/lib/Service/SettingsService.php b/lib/Service/SettingsService.php index 3201ca59..5788173c 100644 --- a/lib/Service/SettingsService.php +++ b/lib/Service/SettingsService.php @@ -63,6 +63,7 @@ class SettingsService { 'showHidden' => (int)$this->settings->getUserValue($this->userId, $this->appName,'various_showHidden'), 'sortOrder' => (string)$this->settings->getUserValue($this->userId, $this->appName,'various_sortOrder'), 'sortDirection' => (bool)$this->settings->getUserValue($this->userId, $this->appName,'various_sortDirection'), + 'allDay' => (bool)$this->settings->getUserValue($this->userId, $this->appName,'various_allDay'), 'userID' => $this->userId ); return $settings; diff --git a/src/store/settings.js b/src/store/settings.js index 440d252c..aefdec3c 100644 --- a/src/store/settings.js +++ b/src/store/settings.js @@ -47,6 +47,14 @@ const getters = { * @returns {String} The sort direction */ sortDirection: (state) => state.settings.sortDirection, + + /** + * Returns if all-day is default + * + * @param {Object} state The store data + * @returns {String} Whether all-day is default + */ + allDay: (state) => state.settings.allDay, } const mutations = { diff --git a/src/store/tasks.js b/src/store/tasks.js index 85d2ffe2..389570a9 100644 --- a/src/store/tasks.js +++ b/src/store/tasks.js @@ -1074,6 +1074,9 @@ const actions = { return task } context.commit('toggleAllDay', task) + if (+context.rootState.settings.settings.allDay !== +task.allDay) { + context.dispatch('setSetting', { type: 'allDay', value: +task.allDay }) + } context.dispatch('scheduleTaskUpdate', task) },