- fix: check if need refresh.. part 1
- keytab in todo...
This commit is contained in:
@@ -277,9 +277,12 @@ self.addEventListener('sync', function (event) {
|
|||||||
})
|
})
|
||||||
.then(function (resData) {
|
.then(function (resData) {
|
||||||
console.log('Result CALL ', method, ' OK? =', resData.ok);
|
console.log('Result CALL ', method, ' OK? =', resData.ok);
|
||||||
if (resData.ok) {
|
|
||||||
|
// Anyway Delete this, otherwise in some cases will return error, but it's not a problem.
|
||||||
|
// for example if I change a record and then I deleted ...
|
||||||
|
// if (resData.ok) {
|
||||||
deleteItemFromData(table, rec._id);
|
deleteItemFromData(table, rec._id);
|
||||||
}
|
// }
|
||||||
|
|
||||||
console.log('DELETE: ', mystrparam)
|
console.log('DELETE: ', mystrparam)
|
||||||
deleteItemFromData('swmsg', mystrparam)
|
deleteItemFromData('swmsg', mystrparam)
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export default class SingleTodo extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Watch('itemtodo.descr',) valueChanged5() {
|
@Watch('itemtodo.descr') valueChanged5() {
|
||||||
this.precDescr = this.itemtodo.descr
|
this.precDescr = this.itemtodo.descr
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,6 +234,8 @@ export default class SingleTodo extends Vue {
|
|||||||
|
|
||||||
exitEdit(singola: boolean = false) {
|
exitEdit(singola: boolean = false) {
|
||||||
if (this.inEdit) {
|
if (this.inEdit) {
|
||||||
|
if (this.precDescr !== this.itemtodo.descr)
|
||||||
|
this.updateTodo()
|
||||||
// console.log('exitEdit')
|
// console.log('exitEdit')
|
||||||
this.inEdit = false
|
this.inEdit = false
|
||||||
this.updateClasses
|
this.updateClasses
|
||||||
@@ -243,12 +245,31 @@ export default class SingleTodo extends Vue {
|
|||||||
|
|
||||||
|
|
||||||
keyDownArea(e) {
|
keyDownArea(e) {
|
||||||
if (e.key === 'Enter' && !e.shiftKey) {
|
/*
|
||||||
e.preventDefault()
|
if ((e.key === 'ArrowUp') && !e.shiftKey) {
|
||||||
|
e.key = 'Tab'
|
||||||
|
e.shiftKey = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((e.key === 'ArrowDown') && !e.shiftKey) {
|
||||||
|
let nextInput = inputs.get(inputs.index(this) + 1)
|
||||||
|
if (nextInput) {
|
||||||
|
nextInput.focus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (((e.key === 'Enter') || (e.key === 'Tab')) && !e.shiftKey) {
|
||||||
this.updateTodo()
|
this.updateTodo()
|
||||||
|
|
||||||
|
if ((e.key === 'Tab') && !e.shiftKey) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
e.preventDefault()
|
||||||
this.deselectRiga()
|
this.deselectRiga()
|
||||||
this.faiFocus('insertTask', true)
|
this.faiFocus('insertTask', true)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// console.log('keyDownArea', e)
|
// console.log('keyDownArea', e)
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
@@ -261,6 +282,9 @@ export default class SingleTodo extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateTodo() {
|
updateTodo() {
|
||||||
|
if (this.itemtodo.descr === this.precDescr)
|
||||||
|
return
|
||||||
|
|
||||||
this.itemtodo.descr = this.precDescr
|
this.itemtodo.descr = this.precDescr
|
||||||
console.log('updateTodo', this.precDescr, this.itemtodo.descr)
|
console.log('updateTodo', this.precDescr, this.itemtodo.descr)
|
||||||
this.watchupdate()
|
this.watchupdate()
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ export default class Todo extends Vue {
|
|||||||
itemDragStart: any = null
|
itemDragStart: any = null
|
||||||
itemDragEnd: any = null
|
itemDragEnd: any = null
|
||||||
selrowid: number = 0
|
selrowid: number = 0
|
||||||
|
polling = null
|
||||||
|
|
||||||
fieldtochange: String [] = ['descr', 'completed', 'category', 'expiring_at', 'priority', 'id_prev', 'id_next', 'pos', 'enableExpiring', 'progress']
|
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)
|
// console.log('Array PRIOR:', this.arrPrior)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beforedestroy() {
|
||||||
|
clearInterval(this.polling)
|
||||||
|
}
|
||||||
|
|
||||||
async load() {
|
async load() {
|
||||||
|
|
||||||
this.todos_arr = [...Todos.state.todos]
|
this.todos_arr = [...Todos.state.todos]
|
||||||
@@ -323,6 +328,9 @@ export default class Todo extends Vue {
|
|||||||
|
|
||||||
await this.updatetable()
|
await this.updatetable()
|
||||||
|
|
||||||
|
|
||||||
|
this.checkUpdate_everytime()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
this.todos_arr.forEach((elem, index) => {
|
this.todos_arr.forEach((elem, index) => {
|
||||||
this.logelem('LOAD ' + index, elem)
|
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) {
|
copy(o) {
|
||||||
let output, v, key
|
let output, v, key
|
||||||
output = Array.isArray(o) ? [] : {}
|
output = Array.isArray(o) ? [] : {}
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ import indexdb from './indexdb'
|
|||||||
|
|
||||||
export default async (context, cmd, table, data = null, id = '') => {
|
export default async (context, cmd, table, data = null, id = '') => {
|
||||||
const descr = data !== null ? data.descr : ''
|
const descr = data !== null ? data.descr : ''
|
||||||
console.log('globalroutines', cmd, table, descr, id)
|
// console.log('globalroutines', cmd, table, descr, id)
|
||||||
return await indexdb(context, cmd, table, data, id)
|
return await indexdb(context, cmd, table, data, id)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,12 +105,12 @@ namespace Actions {
|
|||||||
|
|
||||||
await aspettansec(1000)
|
await aspettansec(1000)
|
||||||
|
|
||||||
console.log('waitAndcheckPendingMsg')
|
// console.log('waitAndcheckPendingMsg')
|
||||||
|
|
||||||
return await checkPendingMsg(context)
|
return await checkPendingMsg(context)
|
||||||
.then(ris => {
|
.then(ris => {
|
||||||
console.log('ris = ', ris)
|
|
||||||
if (ris) {
|
if (ris) {
|
||||||
|
console.log('ris = ', ris)
|
||||||
const result = sendSwMsgIfAvailable()
|
const result = sendSwMsgIfAvailable()
|
||||||
.then(something => {
|
.then(something => {
|
||||||
if (something) {
|
if (something) {
|
||||||
@@ -132,7 +132,7 @@ namespace Actions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function checkPendingMsg(context) {
|
async function checkPendingMsg(context) {
|
||||||
console.log('checkPendingMsg')
|
// console.log('checkPendingMsg')
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
@@ -145,8 +145,8 @@ namespace Actions {
|
|||||||
// Check if there is something
|
// Check if there is something
|
||||||
globalroutines(null, 'count', 'swmsg')
|
globalroutines(null, 'count', 'swmsg')
|
||||||
.then(function (count) {
|
.then(function (count) {
|
||||||
console.log('count = ', count)
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
console.log('count = ', count)
|
||||||
return resolve(true)
|
return resolve(true)
|
||||||
} else {
|
} else {
|
||||||
return resolve(false)
|
return resolve(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user