feat(web): add delete-for-all action for groups in chat info
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-03-08 22:36:26 +03:00
parent ec3dbddad6
commit d971e0ac0f
2 changed files with 23 additions and 1 deletions

View File

@@ -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"