From bfa8a48211200df7e3e758c8e54b0815d7eae91b Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Thu, 14 Feb 2019 19:01:32 +0100 Subject: [PATCH] Fix: Todo Multi refresh ... fix some promises problem --- src/components/todos/todo/todo.ts | 7 +------ src/store/Modules/GlobalStore.ts | 6 +++--- src/store/Modules/Todos.ts | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/components/todos/todo/todo.ts b/src/components/todos/todo/todo.ts index b9f12f5..36e1a2e 100644 --- a/src/components/todos/todo/todo.ts +++ b/src/components/todos/todo/todo.ts @@ -363,7 +363,7 @@ export default class Todo extends Vue { async load() { - this.todos_arr = [...Todos.state.todos] + // this.todos_arr = [...Todos.state.todos] // Set last category selected localStorage.setItem(rescodes.localStorage.categorySel, this.getCategory()) @@ -380,11 +380,6 @@ export default class Todo extends Vue { this.checkUpdate_everytime() - /* - this.todos_arr.forEach((elem, index) => { - this.logelem('LOAD ' + index, elem) - }) - */ this.loadDone = true } diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts index 6c5aaa6..0ebe182 100644 --- a/src/store/Modules/GlobalStore.ts +++ b/src/store/Modules/GlobalStore.ts @@ -183,16 +183,16 @@ namespace Actions { let options = null // If is not already stored in DB, then show the message to the user. - // if (!state.wasAlreadySubscribed) { + if (!state.wasAlreadySubscribed) { options = { title: translate('notification.title_subscribed'), content: translate('notification.subscribed'), openUrl: '/' } - // } + } let myres = { - options: { ...options }, + options, subs: newSub, others: { userId: UserStore.state.userId, diff --git a/src/store/Modules/Todos.ts b/src/store/Modules/Todos.ts index fd466bc..7c26958 100644 --- a/src/store/Modules/Todos.ts +++ b/src/store/Modules/Todos.ts @@ -201,7 +201,7 @@ namespace Actions { // console.log('******* UPDATE TODOS.STATE.TODOS !:', res.todos) if (body.todos) { state.todos = [...body.todos] - Todos.mutations.setTodos_changed() + // Todos.mutations.setTodos_changed() } console.log('********** res', 'state.todos', state.todos, 'checkPending', checkPending)