From 92013aad673a53262255be1e04af6aae59c2f1c3 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 22 Mar 2025 21:58:38 +0100 Subject: [PATCH] don't store settings until conquest is unlocked the client could just not send the request in this case but whatever... --- .../api/entratiLabConquestModeController.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/controllers/api/entratiLabConquestModeController.ts b/src/controllers/api/entratiLabConquestModeController.ts index ae480402..ae7b5845 100644 --- a/src/controllers/api/entratiLabConquestModeController.ts +++ b/src/controllers/api/entratiLabConquestModeController.ts @@ -19,11 +19,11 @@ export const entratiLabConquestModeController: RequestHandler = async (req, res) const weekEnd = weekStart + 604800000; inventory.EntratiVaultCountLastPeriod = 0; inventory.EntratiVaultCountResetDate = new Date(weekEnd); - if ("EntratiLabConquestUnlocked" in inventory) { + if (inventory.EntratiLabConquestUnlocked) { inventory.EntratiLabConquestUnlocked = 0; inventory.EntratiLabConquestActiveFrameVariants = []; } - if ("EchoesHexConquestUnlocked" in inventory) { + if (inventory.EchoesHexConquestUnlocked) { inventory.EchoesHexConquestUnlocked = 0; inventory.EchoesHexConquestActiveFrameVariants = []; inventory.EchoesHexConquestActiveStickers = []; @@ -38,10 +38,14 @@ export const entratiLabConquestModeController: RequestHandler = async (req, res) } } if (body.IsEchoesDeepArchemedea) { - inventory.EchoesHexConquestActiveFrameVariants = body.EchoesHexConquestActiveFrameVariants!; - inventory.EchoesHexConquestActiveStickers = body.EchoesHexConquestActiveStickers!; + if (inventory.EchoesHexConquestUnlocked) { + inventory.EchoesHexConquestActiveFrameVariants = body.EchoesHexConquestActiveFrameVariants!; + inventory.EchoesHexConquestActiveStickers = body.EchoesHexConquestActiveStickers!; + } } else { - inventory.EntratiLabConquestActiveFrameVariants = body.EntratiLabConquestActiveFrameVariants!; + if (inventory.EntratiLabConquestUnlocked) { + inventory.EntratiLabConquestActiveFrameVariants = body.EntratiLabConquestActiveFrameVariants!; + } } await inventory.save(); res.json({