返回提交历史
Modified
src/controllers/custom/configController.ts
+1
-1
XFEstudio/XFESpaceNinjaServer
fix: save config before sending broadcasts (#3181)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3181 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
1946efaf
代码差异
1 个文件
+1
-1
@@ -27,10 +27,10 @@ export const setConfigController: RequestHandler = async (req, res) => {
27
27
const [obj, idx] = configIdToIndexable(id);
28
28
obj[idx] = value;
29
29
}
30
await saveConfig();
30
31
sendWsBroadcastEx({ config_reloaded: true }, undefined, parseInt(String(req.query.wsid)));
31
32
if (isWorldStateUpdate) sendWsBroadcast({ sync_world_state: true });
32
33
syncConfigWithDatabase();
33
await saveConfig();
34
34
res.end();
35
35
} else {
36
36
res.status(401).end();