feat(web): add delete-for-all action for groups in chat info
Some checks failed
CI / test (push) Has been cancelled
Some checks failed
CI / test (push) Has been cancelled
This commit is contained in:
@@ -938,6 +938,28 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
|
||||
|
||||
{showMembersSection && (chat.type === "group" || chat.type === "channel") ? (
|
||||
<>
|
||||
{chat.type === "group" && (myRoleNormalized === "owner" || myRoleNormalized === "admin") ? (
|
||||
<button
|
||||
className="mb-2 w-full rounded bg-red-500 px-3 py-2 text-sm font-semibold text-white hover:bg-red-400"
|
||||
onClick={async () => {
|
||||
const confirmed = window.confirm("Delete this group for all members?");
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await deleteChat(chatId, true);
|
||||
await loadChats();
|
||||
setActiveChatId(null);
|
||||
onClose();
|
||||
} catch {
|
||||
setError("Failed to delete group");
|
||||
}
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
Delete group for all
|
||||
</button>
|
||||
) : null}
|
||||
{chat.type === "channel" && (myRoleNormalized === "owner" || myRoleNormalized === "admin") ? (
|
||||
<button
|
||||
className="mb-2 w-full rounded bg-red-500 px-3 py-2 text-sm font-semibold text-white hover:bg-red-400"
|
||||
|
||||
Reference in New Issue
Block a user