From fbebd86faf6546c77487e5cc0e47c8d5e248ff9a Mon Sep 17 00:00:00 2001
From: AAA <35992542+TNTcraftHIM@users.noreply.github.com>
Date: Fri, 13 Nov 2026 22:10:58 -0400
Subject: [PATCH] fix(ui): keep room actions in their settings scope
---
.../components/ChannelRoomControls.tsx | 32 +++++++++----------
.../components/ChannelRoomInvitation.tsx | 2 +-
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/client/channel/components/ChannelRoomControls.tsx b/src/client/channel/components/ChannelRoomControls.tsx
index b75affa50..729e2d234 100644
--- a/src/client/channel/components/ChannelRoomControls.tsx
+++ b/src/client/channel/components/ChannelRoomControls.tsx
@@ -256,14 +256,28 @@ function RoomSettings({ channel, room, onClose }: {
{zh ? "已获准的用户" : "Users with access"}
{members.map(userId =>
{userProfile(channel.state, channel.profiles, userId)?.name ?? (zh ? "用户" : "User")}
- { void run(() => channel.revokeRoomAccess(room.id, userId, false)); }} />
)}
{membersError && {zh ? "未能读取用户资料,请重新打开重试。" : "Could not load user profiles. Reopen to retry."}
}
}
+
+ {
+ const deleteData = room.available;
+ const question = deleteData
+ ? (zh ? `删除“${room.name}”及其聊天记录?已下载的文件保留。若托管端已离线,则仅从列表中移除。`
+ : `Delete “${room.name}” and its chat history? Downloaded files are kept. If hosting has gone offline, only its list entry will be removed.`)
+ : (zh ? `从列表中移除“${room.name}”?离线托管端的数据保留。`
+ : `Remove “${room.name}” from this list? Data on its offline host is kept.`);
+ if (window.confirm(question)) void run(() => channel.deleteRoom(room.id, deleteData, false), onClose);
+ }} />
+
}
{room.authorized &&
- {zh ? "连接设置" : "Connection settings"}
+ {zh ? "本机连接" : "This device"}
}
{(room.authorized || room.canManage) &&
@@ -283,20 +297,6 @@ function RoomSettings({ channel, room, onClose }: {
throw error;
}
}} />}
- {room.canManage &&
- {
- const deleteData = room.available;
- const question = deleteData
- ? (zh ? `删除“${room.name}”及其聊天记录?已下载的文件保留。若托管端已离线,则仅从列表中移除。`
- : `Delete “${room.name}” and its chat history? Downloaded files are kept. If hosting has gone offline, only its list entry will be removed.`)
- : (zh ? `从列表中移除“${room.name}”?离线托管端的数据保留。`
- : `Remove “${room.name}” from this list? Data on its offline host is kept.`);
- if (window.confirm(question)) void run(() => channel.deleteRoom(room.id, deleteData, false), onClose);
- }} />
- }
}
diff --git a/src/client/channel/components/ChannelRoomInvitation.tsx b/src/client/channel/components/ChannelRoomInvitation.tsx
index 905e1ee1d..36305dc83 100644
--- a/src/client/channel/components/ChannelRoomInvitation.tsx
+++ b/src/client/channel/components/ChannelRoomInvitation.tsx
@@ -61,7 +61,7 @@ function RoomInvitation({ channel, room, onClose, onManageAccess }: {
: room.canManage && available && invitation.state === "available" ? invitation.url : "";
const { message } = channelErrorPresentation(error, t);
const generate = (reset = false) => { void run(() => channel.createRoomInvite(room.id, false), url => setInvitation({ state: "available", url })); }} />;
return <>