Save last value of all-day toggle

Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
Raimund Schlüßler 2019-09-17 19:21:33 +02:00
parent 442f43d7e0
commit 34a2276c52
No known key found for this signature in database
GPG Key ID: 036FA7EB1A599178
3 changed files with 12 additions and 0 deletions

View File

@ -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;

View File

@ -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 = {

View File

@ -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)
},