chore(webui): sync account cheats between different webui tabs (#2863)
Reviewed-on: #2863 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
43bc12713a
commit
0f7a85db59
@ -1,6 +1,6 @@
|
||||
import { getInventory } from "../../services/inventoryService.ts";
|
||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
||||
import { sendWsBroadcastEx, sendWsBroadcastTo } from "../../services/wsService.ts";
|
||||
import type { IAccountCheats } from "../../types/inventoryTypes/inventoryTypes.ts";
|
||||
import type { RequestHandler } from "express";
|
||||
import { logger } from "../../utils/logger.ts";
|
||||
@ -20,6 +20,8 @@ export const setAccountCheatController: RequestHandler = async (req, res) => {
|
||||
res.end();
|
||||
if (["infiniteCredits", "infinitePlatinum", "infiniteEndo", "infiniteRegalAya"].indexOf(payload.key) != -1) {
|
||||
sendWsBroadcastTo(accountId, { update_inventory: true, sync_inventory: true });
|
||||
} else {
|
||||
sendWsBroadcastEx({ update_inventory: true }, accountId, parseInt(String(req.query.wsid)));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user