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