mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-05 03:38:15 +00:00
feat: 优化应用激活逻辑,增加 IndexedDB 测试失败时的提前返回处理
This commit is contained in:
parent
43746634a5
commit
5121739fe4
@ -650,11 +650,16 @@ export default {
|
|||||||
this.appActivated && $A.eeuiAppHideWebviewSnapshot()
|
this.appActivated && $A.eeuiAppHideWebviewSnapshot()
|
||||||
}, 500)
|
}, 500)
|
||||||
// APP进入前台
|
// APP进入前台
|
||||||
window.__onAppActive = () => {
|
window.__onAppActive = async () => {
|
||||||
this.appActivated = true
|
this.appActivated = true
|
||||||
|
|
||||||
|
// IndexedDB 测试失败时会自动刷新页面,这里提前返回防止后续代码执行
|
||||||
|
if (!await $A.IDBTest()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.autoTheme()
|
this.autoTheme()
|
||||||
$A.updateTimezone()
|
$A.updateTimezone()
|
||||||
$A.IDBTest()
|
|
||||||
$A.eeuiAppHideWebviewSnapshot()
|
$A.eeuiAppHideWebviewSnapshot()
|
||||||
this.$store.dispatch("safeAreaInsets")
|
this.$store.dispatch("safeAreaInsets")
|
||||||
const nowYmd = $A.daytz().format('YYYY-MM-DD')
|
const nowYmd = $A.daytz().format('YYYY-MM-DD')
|
||||||
|
|||||||
2
resources/assets/js/functions/common.js
vendored
2
resources/assets/js/functions/common.js
vendored
@ -1574,6 +1574,7 @@ const timezone = require("dayjs/plugin/timezone");
|
|||||||
await localforage.setItem('__test__', $A.dayjs().valueOf())
|
await localforage.setItem('__test__', $A.dayjs().valueOf())
|
||||||
}
|
}
|
||||||
$A.openLog && console.log('IDBTest OK')
|
$A.openLog && console.log('IDBTest OK')
|
||||||
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if ($A.openLog) {
|
if ($A.openLog) {
|
||||||
console.error('IDBTest Error: ', error)
|
console.error('IDBTest Error: ', error)
|
||||||
@ -1586,6 +1587,7 @@ const timezone = require("dayjs/plugin/timezone");
|
|||||||
} else {
|
} else {
|
||||||
$A.reloadUrl();
|
$A.reloadUrl();
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user