Notification Screen and tasq_adaptive_list enhancements
This commit is contained in:
@@ -317,6 +317,21 @@ class NotificationsController {
|
||||
}
|
||||
}
|
||||
|
||||
/// Mark all unread notifications for the current user as read.
|
||||
Future<void> markAllRead() async {
|
||||
final userId = _client.auth.currentUser?.id;
|
||||
if (userId == null) return;
|
||||
try {
|
||||
await _client
|
||||
.from('notifications')
|
||||
.update({'read_at': AppTime.nowUtc().toIso8601String()})
|
||||
.eq('user_id', userId)
|
||||
.filter('read_at', 'is', null);
|
||||
} catch (e) {
|
||||
if (!isOfflineSaveError(e)) rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> registerFcmToken(String token) async {
|
||||
final userId = _client.auth.currentUser?.id;
|
||||
if (userId == null) return;
|
||||
|
||||
Reference in New Issue
Block a user