mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 05:12:49 +00:00
perf: 优化数据结构
This commit is contained in:
parent
cedffd17b3
commit
195a305fc3
4
resources/assets/js/app.js
vendored
4
resources/assets/js/app.js
vendored
@ -219,6 +219,7 @@ if (isElectron) {
|
||||
|
||||
// 同步执行派遣
|
||||
const dispatchId = $A.randomString(6) + "_" + Date.now().toString()
|
||||
$A.syncPauses = new Map();
|
||||
$A.syncDispatch = (action, data) => {
|
||||
if (!$A.Ready) {
|
||||
return false
|
||||
@ -226,6 +227,9 @@ $A.syncDispatch = (action, data) => {
|
||||
if (!isElectron) {
|
||||
return false
|
||||
}
|
||||
if ($A.syncPauses.has(action)) {
|
||||
return false;
|
||||
}
|
||||
if (!$A.isJson(data)) {
|
||||
return false
|
||||
}
|
||||
|
||||
@ -2037,11 +2037,13 @@ export default {
|
||||
getMsgs(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(_ => this.msgLoadIng++, 2000)
|
||||
$A.isSubElectron && $A.syncPauses.set("saveDialogMsg", true)
|
||||
this.$store.dispatch("getDialogMsgs", data)
|
||||
.then(resolve)
|
||||
.catch(reject)
|
||||
.finally(_ => {
|
||||
this.msgLoadIng--
|
||||
$A.isSubElectron && $A.syncPauses.delete("saveDialogMsg")
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user