++ If press DELETE or BACKSPACE and is blank description, delete the Todos.

- fix: if offline, doesn't save to cache??  if I refresh page, the data disappear
- ++ field to the percent progress
- fix: Refreshing 2 times the array todos.. because there is a filter
This commit is contained in:
Paolo Arena
2019-02-12 19:09:43 +01:00
parent a024b78e95
commit 259e2dc4e2
17 changed files with 252 additions and 188 deletions

View File

@@ -43,7 +43,7 @@ namespace Mutations {
function setTodos_changed(state: ITodosState) {
state.todos_changed++
mutations.setTestpao('Cambiato : ' + String(state.todos_changed))
console.log('******************************* state.todos_changed', state.todos_changed)
console.log('******* state.todos_changed', state.todos_changed)
}
export const mutations = {
@@ -195,16 +195,16 @@ namespace Actions {
state.networkDataReceived = false
let ris = await Api.SendReq(call, 'GET', null)
.then(({ resData, body, status }) => {
.then(({ res, body, status }) => {
state.networkDataReceived = true
// console.log('******* UPDATE TODOS.STATE.TODOS !:', resData.todos)
// console.log('******* UPDATE TODOS.STATE.TODOS !:', res.todos)
if (body.todos) {
state.todos = [...body.todos]
Todos.mutations.setTodos_changed()
}
console.log('********** resData', resData, 'state.todos', state.todos, 'checkPending', checkPending)
console.log('********** res', res, 'state.todos', state.todos, 'checkPending', checkPending)
// After Login will store into the indexedDb...
@@ -216,8 +216,8 @@ namespace Actions {
return { status }
})
console.log('ris : ', ris)
console.log('ris STATUS: ', ris.status)
// console.log('ris : ', ris)
// console.log('ris STATUS: ', ris.status)
if (!Todos.state.networkDataReceived) {