From 816c5bb4ec28d7a9b3d0797991ba5ee49431fc1d Mon Sep 17 00:00:00 2001 From: Sytone Date: Tue, 8 Jun 2021 08:24:11 -0700 Subject: [PATCH] Set list in search box in settings --- src/components/tasks/add-task.vue | 4 ++-- src/components/tasks/partials/listSearch.vue | 9 ++++++--- src/models/userSettings.js | 2 +- src/store/modules/auth.js | 6 +++--- src/views/user/Settings.vue | 4 ++-- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/tasks/add-task.vue b/src/components/tasks/add-task.vue index 8607574b1..a1df50fb5 100644 --- a/src/components/tasks/add-task.vue +++ b/src/components/tasks/add-task.vue @@ -78,8 +78,8 @@ export default { if (this.listId !== undefined) { this.listIdForNewTask = this.listId this.validListIdAvailable = true - } else if(this.$store.state.auth.settings.defaultListID !== undefined) { - this.listIdForNewTask = this.$store.state.auth.settings.defaultListID + } else if(this.$store.state.auth.settings.defaultListId !== undefined) { + this.listIdForNewTask = this.$store.state.auth.settings.defaultListId this.validListIdAvailable = true } }, diff --git a/src/components/tasks/partials/listSearch.vue b/src/components/tasks/partials/listSearch.vue index 06c14f3a3..3c2bf336f 100644 --- a/src/components/tasks/partials/listSearch.vue +++ b/src/components/tasks/partials/listSearch.vue @@ -42,8 +42,10 @@ export default { }, }, beforeMount() { - this.listSerivce = new ListService() + this.listService = new ListService() this.list = new ListModel() + }, + mounted() { if (this.listId !== undefined) { this.getListById() } @@ -55,9 +57,10 @@ export default { return } - this.listSerivce.getAll({}, {s: query}) + this.listService.getAll({}, {s: query}) .then(response => { this.$set(this, 'foundLists', response) + this.$set(this, 'list', response) }) .catch(e => { this.error(e, this) @@ -66,7 +69,7 @@ export default { getListById() { this.listService.get({id: this.listId}) .then(response => { - this.$set(this, 'foundLists', response) + this.list = response }) .catch(e => { this.error(e, this) diff --git a/src/models/userSettings.js b/src/models/userSettings.js index 5d3973be2..cb72fd3ec 100644 --- a/src/models/userSettings.js +++ b/src/models/userSettings.js @@ -9,7 +9,7 @@ export default class UserSettingsModel extends AbstractModel { discoverableByName: false, discoverableByEmail: false, overdueTasksRemindersEnabled: true, - defaultListID: 1, + defaultListId: 1, weekStart: 0, } } diff --git a/src/store/modules/auth.js b/src/store/modules/auth.js index 78aa3e831..1776c3a20 100644 --- a/src/store/modules/auth.js +++ b/src/store/modules/auth.js @@ -3,9 +3,9 @@ import { ERROR_MESSAGE, LOADING } from '../mutation-types' import UserModel from '../../models/user' const defaultSettings = settings => { - if (typeof settings.defaultListID === 'undefined' || settings.defaultListID === '') { - settings.defaultListID = 1 - } + // if (typeof settings.defaultListId === 'undefined' || settings.defaultListId === '') { + // settings.defaultListId = 1 + // } if (typeof settings.weekStart === 'undefined' || settings.weekStart === '') { settings.weekStart = 0 } diff --git a/src/views/user/Settings.vue b/src/views/user/Settings.vue index b7941dbb2..446fb60c7 100644 --- a/src/views/user/Settings.vue +++ b/src/views/user/Settings.vue @@ -138,7 +138,7 @@ Default list for new tasks is
- +
@@ -433,7 +433,7 @@ export default { copy(text) }, changeList(list) { - this.settings.defaultListID = list.id + this.settings.defaultListId = list.id }, }, }