mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: 修复设置中无法取消选中checkbox的问题
This commit is contained in:
1 parent
7a41fecb0e
commit
a81d514b10
11 files changed
+29
-21
No files matched your search
@@ -159,7 +159,7 @@ class JudgeConnectionHandler extends ConnectionHandler {
|
||||
async cleanup() {
|
||||
if (this.processing) {
|
||||
await record.reset(this.processing.domainId, this.processing.rid, false);
|
||||
task.add(this.processing);
|
||||
await task.add(this.processing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,6 +144,8 @@ class SystemSettingHandler extends SystemHandler {
|
||||
|
||||
async post(args: any) {
|
||||
const tasks = [];
|
||||
const booleanKeys = args.booleanKeys || {};
|
||||
delete args.booleanKeys;
|
||||
for (const key in args) {
|
||||
if (typeof args[key] === 'object') {
|
||||
for (const subkey in args[key]) {
|
||||
@@ -154,6 +156,13 @@ class SystemSettingHandler extends SystemHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const key in booleanKeys) {
|
||||
if (typeof booleanKeys[key] === 'object') {
|
||||
for (const subkey in booleanKeys[key]) {
|
||||
if (!args[key][subkey]) tasks.push(system.set(`${key}.${subkey}`, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
tasks.push(bus.parallel('system/setting', args));
|
||||
await Promise.all(tasks);
|
||||
this.back();
|
||||
|
||||
Reference in new issue
Block a user