- fix: check if need refresh.. part 1

- keytab in todo...
This commit is contained in:
Paolo Arena
2019-02-04 04:17:50 +01:00
parent b2e760faa9
commit fb099322d4
5 changed files with 55 additions and 13 deletions

View File

@@ -41,6 +41,7 @@ export default class Todo extends Vue {
itemDragStart: any = null
itemDragEnd: any = null
selrowid: number = 0
polling = null
fieldtochange: String [] = ['descr', 'completed', 'category', 'expiring_at', 'priority', 'id_prev', 'id_next', 'pos', 'enableExpiring', 'progress']
@@ -307,6 +308,10 @@ export default class Todo extends Vue {
// console.log('Array PRIOR:', this.arrPrior)
}
beforedestroy() {
clearInterval(this.polling)
}
async load() {
this.todos_arr = [...Todos.state.todos]
@@ -323,6 +328,9 @@ export default class Todo extends Vue {
await this.updatetable()
this.checkUpdate_everytime()
/*
this.todos_arr.forEach((elem, index) => {
this.logelem('LOAD ' + index, elem)
@@ -331,6 +339,13 @@ export default class Todo extends Vue {
}
// Call to check if need to refresh
checkUpdate_everytime() {
this.polling = setInterval(() => {
this.checkUpdate()
}, 10000)
}
copy(o) {
let output, v, key
output = Array.isArray(o) ? [] : {}