2019-03-11 19:21:10 +01:00
|
|
|
import indexdb from './indexdb'
|
2019-03-16 23:47:13 +01:00
|
|
|
import { GlobalStore } from '../store/Modules'
|
2019-03-11 19:21:10 +01:00
|
|
|
|
|
|
|
|
export default async (context, cmd, table, data = null, id = '') => {
|
2021-04-30 01:32:44 +02:00
|
|
|
// const descr = data !== null ? data.descr : ''
|
2019-03-11 19:21:10 +01:00
|
|
|
// console.log('globalroutines', cmd, table, descr, id)
|
2021-04-30 01:32:44 +02:00
|
|
|
return indexdb(context, cmd, table, data, id)
|
2021-02-03 01:32:56 +01:00
|
|
|
.then((ris) => {
|
2021-04-30 01:32:44 +02:00
|
|
|
console.log('GlobalStore.state.connData', GlobalStore.state.connData)
|
|
|
|
|
|
2021-02-03 01:32:56 +01:00
|
|
|
setTimeout(() => {
|
|
|
|
|
GlobalStore.state.connData.uploading_indexeddb = 0
|
|
|
|
|
GlobalStore.state.connData.downloading_indexeddb = 0
|
|
|
|
|
}, 1000)
|
|
|
|
|
return ris
|
|
|
|
|
}
|
|
|
|
|
).catch((err) => {
|
2019-03-16 23:47:13 +01:00
|
|
|
setTimeout(() => {
|
2019-03-11 19:21:10 +01:00
|
|
|
GlobalStore.state.connData.uploading_indexeddb = (GlobalStore.state.connData.uploading_indexeddb === 1) ? -1 : GlobalStore.state.connData.uploading_indexeddb
|
|
|
|
|
GlobalStore.state.connData.downloading_indexeddb = (GlobalStore.state.connData.downloading_indexeddb === 1) ? -1 : GlobalStore.state.connData.downloading_indexeddb
|
|
|
|
|
}, 1000)
|
|
|
|
|
|
|
|
|
|
console.log('ERROR INDEXEDDB: ', err)
|
|
|
|
|
})
|
|
|
|
|
}
|