From 0a7112d8319d2cdf69e5b83cbf71c70d61a3baf1 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 24 May 2026 16:04:47 +0300 Subject: [PATCH] Update members list when user leaves or is kicked from group --- .../sendouq/actions/q.looking.server.ts | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/features/sendouq/actions/q.looking.server.ts b/app/features/sendouq/actions/q.looking.server.ts index c539d42b1..2c562d8f7 100644 --- a/app/features/sendouq/actions/q.looking.server.ts +++ b/app/features/sendouq/actions/q.looking.server.ts @@ -261,15 +261,17 @@ export const action: ActionFunction = async ({ request }) => { await refreshSendouQInstance(); - const targetChatCode = SendouQ.findUncensoredGroupById( - currentGroup.id, - )?.chatCode; - if (targetChatCode) { + const remainingGroup = SendouQ.findUncensoredGroupById(currentGroup.id); + if (remainingGroup?.chatCode) { ChatSystemMessage.send({ - room: targetChatCode, + room: remainingGroup.chatCode, type: "USER_LEFT", context: { name: user.username }, }); + setGroupChatMetadata({ + chatCode: remainingGroup.chatCode, + members: remainingGroup.members, + }); } throw redirect(SENDOUQ_PAGE); @@ -282,6 +284,14 @@ export const action: ActionFunction = async ({ request }) => { await refreshSendouQInstance(); + const remainingGroup = SendouQ.findUncensoredGroupById(currentGroup.id); + if (remainingGroup?.chatCode) { + setGroupChatMetadata({ + chatCode: remainingGroup.chatCode, + members: remainingGroup.members, + }); + } + break; } case "REFRESH_GROUP": {