Fix: Todo Multi refresh ...

fix some promises problem
This commit is contained in:
Paolo Arena
2019-02-14 19:01:32 +01:00
parent 6931d57005
commit bfa8a48211
3 changed files with 5 additions and 10 deletions

View File

@@ -363,7 +363,7 @@ export default class Todo extends Vue {
async load() { async load() {
this.todos_arr = [...Todos.state.todos] // this.todos_arr = [...Todos.state.todos]
// Set last category selected // Set last category selected
localStorage.setItem(rescodes.localStorage.categorySel, this.getCategory()) localStorage.setItem(rescodes.localStorage.categorySel, this.getCategory())
@@ -380,11 +380,6 @@ export default class Todo extends Vue {
this.checkUpdate_everytime() this.checkUpdate_everytime()
/*
this.todos_arr.forEach((elem, index) => {
this.logelem('LOAD ' + index, elem)
})
*/
this.loadDone = true this.loadDone = true
} }

View File

@@ -183,16 +183,16 @@ namespace Actions {
let options = null let options = null
// If is not already stored in DB, then show the message to the user. // If is not already stored in DB, then show the message to the user.
// if (!state.wasAlreadySubscribed) { if (!state.wasAlreadySubscribed) {
options = { options = {
title: translate('notification.title_subscribed'), title: translate('notification.title_subscribed'),
content: translate('notification.subscribed'), content: translate('notification.subscribed'),
openUrl: '/' openUrl: '/'
} }
// } }
let myres = { let myres = {
options: { ...options }, options,
subs: newSub, subs: newSub,
others: { others: {
userId: UserStore.state.userId, userId: UserStore.state.userId,

View File

@@ -201,7 +201,7 @@ namespace Actions {
// console.log('******* UPDATE TODOS.STATE.TODOS !:', res.todos) // console.log('******* UPDATE TODOS.STATE.TODOS !:', res.todos)
if (body.todos) { if (body.todos) {
state.todos = [...body.todos] state.todos = [...body.todos]
Todos.mutations.setTodos_changed() // Todos.mutations.setTodos_changed()
} }
console.log('********** res', 'state.todos', state.todos, 'checkPending', checkPending) console.log('********** res', 'state.todos', state.todos, 'checkPending', checkPending)