- updated SendReq

- If Server Down the login msg error corrected.
This commit is contained in:
Paolo Arena
2019-02-07 00:53:10 +01:00
parent cb62d46048
commit 5ee0d8e171
8 changed files with 51 additions and 25 deletions

View File

@@ -85,11 +85,11 @@ export default class Todo extends Vue {
@Watch('reload_fromServer', { immediate: true })
reload_fromServer_changed(value: string, oldValue: string) {
console.log('reload_fromServer_changed!', value, oldValue)
if (value) {
// if (value) {
Todos.actions.dbLoadTodo(false)
Todos.actions.updateArrayInMemory()
}
// }
}
@@ -397,10 +397,20 @@ export default class Todo extends Vue {
return ''
}
isRegistered() {
return localStorage.getItem(rescodes.localStorage.userId) !== ''
}
async insertTodo() {
if (this.todo.trim() === '')
return
if (!this.isRegistered()) {
// Not logged
this.$q.notify(this.$t('user.notregistered'))
return
}
const objtodo = this.initcat()
console.log('insertTodo ', UserStore.state.userId)