fix: fix redirect after delete chat from details page

This commit is contained in:
ggurdin 2025-11-05 14:48:18 -05:00
parent ffb27d4a75
commit 84e4fbcde8
No known key found for this signature in database
GPG key ID: A01CB41737CBB478

View file

@ -152,6 +152,7 @@ class ChatDetailsButtonRowState extends State<ChatDetailsButtonRow> {
title: l10n.delete,
icon: const Icon(Icons.delete_outline, size: 30.0),
onPressed: () async {
final parentSpaceId = room.courseParent?.id;
final confirmed = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context).areYouSure,
@ -167,7 +168,11 @@ class ChatDetailsButtonRowState extends State<ChatDetailsButtonRow> {
future: room.delete,
);
if (resp.isError) return;
context.go("/rooms");
context.go(
parentSpaceId != null
? "/rooms/spaces/$parentSpaceId/details"
: "/rooms",
);
},
enabled: room.isRoomAdmin,
visible: !room.isDirectChat,