mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-12 14:16:04 -05:00
Update members list when user leaves or is kicked from group
This commit is contained in:
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user