feat: 优化应用激活逻辑,增加 IndexedDB 测试失败时的提前返回处理

This commit is contained in:
kuaifan 2025-11-03 00:34:32 +08:00
parent 43746634a5
commit 5121739fe4
2 changed files with 9 additions and 2 deletions

View File

@ -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')

View File

@ -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;
}
},