mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Mark notification as read when navigating to device
Tapping a notification row or selecting "View device" from the popup menu now marks the notification as read (if unread) before navigating to the device detail page. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
22d30a146c
commit
e8df0a3980
@@ -211,7 +211,8 @@ class _NotificationListState extends State<NotificationList> {
|
|||||||
icon: const Icon(Icons.more_vert),
|
icon: const Icon(Icons.more_vert),
|
||||||
onSelected: (value) async {
|
onSelected: (value) async {
|
||||||
if (value == 'view_device') {
|
if (value == 'view_device') {
|
||||||
context.push('/devices/${item.macAddress}');
|
if (item.isNew) await _markAsRead(context, item);
|
||||||
|
if (context.mounted) context.push('/devices/${item.macAddress}');
|
||||||
} else if (value == 'mark_read') {
|
} else if (value == 'mark_read') {
|
||||||
await _markAsRead(context, item);
|
await _markAsRead(context, item);
|
||||||
} else if (value == 'mark_new') {
|
} else if (value == 'mark_new') {
|
||||||
@@ -237,8 +238,10 @@ class _NotificationListState extends State<NotificationList> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
onTap: item.macAddress != null
|
onTap: item.macAddress != null
|
||||||
? () =>
|
? () async {
|
||||||
context.push('/devices/${item.macAddress}')
|
if (item.isNew) await _markAsRead(context, item);
|
||||||
|
if (context.mounted) context.push('/devices/${item.macAddress}');
|
||||||
|
}
|
||||||
: null,
|
: null,
|
||||||
isThreeLine: true,
|
isThreeLine: true,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user