mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
perf: 优化iOS端数据读取失败的情况
This commit is contained in:
parent
4038d9560f
commit
d34d94faa6
@ -290,6 +290,7 @@ export default {
|
||||
// APP进入前台
|
||||
window.__onAppActive = () => {
|
||||
this.autoTheme()
|
||||
$A.IDBTest()
|
||||
}
|
||||
// 页面失活
|
||||
window.__onPagePause = () => {
|
||||
|
||||
13
resources/assets/js/functions/common.js
vendored
13
resources/assets/js/functions/common.js
vendored
@ -541,7 +541,7 @@ const localforage = require("localforage");
|
||||
if (height !== tmpHeight || width !== tmpWidth) {
|
||||
height = tmpHeight;
|
||||
width = tmpWidth;
|
||||
console.log(width, height);
|
||||
$A.openLog && console.log(width, height);
|
||||
if (typeof callback === 'function') callback();
|
||||
}
|
||||
}, 250);
|
||||
@ -1371,6 +1371,17 @@ const localforage = require("localforage");
|
||||
$.extend({
|
||||
__IDBTimer: {},
|
||||
|
||||
async IDBTest() {
|
||||
try {
|
||||
if ($A.isIos()) {
|
||||
await localforage.setItem('__test__', $A.Time())
|
||||
}
|
||||
$A.openLog && console.log('IDBTest OK',)
|
||||
} catch (error) {
|
||||
$A.openLog && console.error('IDBTest Error: ', error)
|
||||
}
|
||||
},
|
||||
|
||||
IDBSave(key, value, delay = 100) {
|
||||
if (typeof this.__IDBTimer[key] !== "undefined") {
|
||||
clearTimeout(this.__IDBTimer[key])
|
||||
|
||||
@ -224,6 +224,7 @@
|
||||
.ivu-tag {
|
||||
margin: 0 4px 0 0;
|
||||
padding: 0 5px;
|
||||
box-sizing: content-box;
|
||||
&.ivu-tag-success {
|
||||
padding: 0 6px;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user