Fixed Dashboard full page refresh

This commit is contained in:
2026-02-18 23:37:21 +08:00
parent 5ec57a1cec
commit f9f3509188
7 changed files with 118 additions and 43 deletions
@@ -904,10 +904,10 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
return PopupMenuButton<String>(
onSelected: (value) async {
// Rely on the realtime stream to propagate the status change.
await ref
.read(ticketsControllerProvider)
.updateTicketStatus(ticketId: ticket.id, status: value);
ref.invalidate(ticketsProvider);
},
itemBuilder: (context) => availableStatuses
.map(
+2 -1
View File
@@ -404,7 +404,8 @@ class _TicketsListScreenState extends ConsumerState<TicketsListScreen> {
description: description,
officeId: selectedOffice!.id,
);
ref.invalidate(ticketsProvider);
// Supabase stream will emit the new ticket — no explicit
// invalidation required and avoids a temporary reload.
if (context.mounted) {
Navigator.of(dialogContext).pop();
}