diff --git a/src/controllers/api/loginRewardsController.ts b/src/controllers/api/loginRewardsController.ts index 8959c5c7..19940d08 100644 --- a/src/controllers/api/loginRewardsController.ts +++ b/src/controllers/api/loginRewardsController.ts @@ -9,6 +9,7 @@ import { } from "@/src/services/loginRewardService"; import { getInventory } from "@/src/services/inventoryService"; import { config } from "@/src/services/configService"; +import { sendWsBroadcastTo } from "@/src/services/webService"; export const loginRewardsController: RequestHandler = async (req, res) => { const account = await getAccountForRequest(req); @@ -51,6 +52,8 @@ export const loginRewardsController: RequestHandler = async (req, res) => { setAccountGotLoginRewardToday(account); await account.save(); + + sendWsBroadcastTo(account._id.toString(), { update_inventory: true }); } res.json(response); }; diff --git a/src/controllers/api/loginRewardsSelectionController.ts b/src/controllers/api/loginRewardsSelectionController.ts index 290a13f8..e3a699ec 100644 --- a/src/controllers/api/loginRewardsSelectionController.ts +++ b/src/controllers/api/loginRewardsSelectionController.ts @@ -6,6 +6,7 @@ import { } from "@/src/services/loginRewardService"; import { getAccountForRequest } from "@/src/services/loginService"; import { handleStoreItemAcquisition } from "@/src/services/purchaseService"; +import { sendWsBroadcastTo } from "@/src/services/webService"; import { IInventoryChanges } from "@/src/types/purchaseTypes"; import { logger } from "@/src/utils/logger"; import { RequestHandler } from "express"; @@ -39,6 +40,7 @@ export const loginRewardsSelectionController: RequestHandler = async (req, res) setAccountGotLoginRewardToday(account); await account.save(); + sendWsBroadcastTo(account._id.toString(), { update_inventory: true }); res.json({ DailyTributeInfo: { NewInventory: inventoryChanges,