First Committ
This commit is contained in:
31
src/globalroutines/index.ts
Executable file
31
src/globalroutines/index.ts
Executable file
@@ -0,0 +1,31 @@
|
||||
// import { useGlobalStore } from '@store/globalStore'
|
||||
// import indexdb from './indexdb'
|
||||
|
||||
import { idbKeyval as storage } from '@src/js/storage'
|
||||
|
||||
export default async (context: any, cmd: string, table: string, data: any = null, id = '') => {
|
||||
// const globalStore = useGlobalStore()
|
||||
|
||||
// const descr = data !== null ? data.descr : ''
|
||||
// console.log('globalroutines', cmd, table, descr, id)
|
||||
return storage.setdata(table, data)
|
||||
/*return indexdb(context, cmd, table, data, id)
|
||||
.then((ris) => {
|
||||
// console.log('globalStore.state.connData', globalStore.state.connData)
|
||||
|
||||
setTimeout(() => {
|
||||
// globalStore.connData.uploading_indexeddb = 0
|
||||
// globalStore.connData.downloading_indexeddb = 0
|
||||
}, 1000)
|
||||
return ris
|
||||
}).catch((err) => {
|
||||
setTimeout(() => {
|
||||
// globalStore.connData.uploading_indexeddb = (globalStore.connData.uploading_indexeddb === 1) ? -1 : globalStore.connData.uploading_indexeddb
|
||||
// globalStore.connData.downloading_indexeddb = (globalStore.connData.downloading_indexeddb === 1) ? -1 : globalStore.connData.downloading_indexeddb
|
||||
}, 1000)
|
||||
|
||||
console.log('ERROR INDEXEDDB: ', err)
|
||||
})
|
||||
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user