diff --git a/go-backend/internal/repository/notification_repository.go b/go-backend/internal/repository/notification_repository.go index 561f714..042e6f9 100644 --- a/go-backend/internal/repository/notification_repository.go +++ b/go-backend/internal/repository/notification_repository.go @@ -254,7 +254,7 @@ func (r *NotificationRepository) MarkNotificationsAsRead(ctx context.Context, id func (r *NotificationRepository) ArchiveNotifications(ctx context.Context, ids []string, userID string) error { _, err := r.pool.Exec(ctx, ` - UPDATE public.notifications SET archived_at = NOW() + UPDATE public.notifications SET archived_at = NOW(), is_read = TRUE WHERE id = ANY($1::uuid[]) AND user_id = $2::uuid `, ids, userID) return err @@ -262,7 +262,7 @@ func (r *NotificationRepository) ArchiveNotifications(ctx context.Context, ids [ func (r *NotificationRepository) ArchiveAllNotifications(ctx context.Context, userID string) error { _, err := r.pool.Exec(ctx, ` - UPDATE public.notifications SET archived_at = NOW() + UPDATE public.notifications SET archived_at = NOW(), is_read = TRUE WHERE user_id = $1::uuid AND archived_at IS NULL `, userID) return err diff --git a/sojorn_app/lib/screens/home/home_shell.dart b/sojorn_app/lib/screens/home/home_shell.dart index a6191d7..e7030f4 100644 --- a/sojorn_app/lib/screens/home/home_shell.dart +++ b/sojorn_app/lib/screens/home/home_shell.dart @@ -300,43 +300,10 @@ class _HomeShellState extends ConsumerState with WidgetsBindingObserv ), tooltip: 'Notifications', onPressed: () { - showGeneralDialog( - context: context, - barrierDismissible: true, - barrierLabel: 'Notifications', - barrierColor: Colors.black54, - transitionDuration: const Duration(milliseconds: 250), - pageBuilder: (context, _, __) { - final height = MediaQuery.of(context).size.height; - return Align( - alignment: Alignment.topCenter, - child: SafeArea( - bottom: false, - child: ClipRRect( - borderRadius: const BorderRadius.vertical( - bottom: Radius.circular(20), - ), - child: SizedBox( - height: height * 0.9, - child: const NotificationsScreen(), - ), - ), - ), - ); - }, - transitionBuilder: (context, animation, _, child) { - final curve = CurvedAnimation( - parent: animation, - curve: Curves.easeOutCubic, - ); - return SlideTransition( - position: Tween( - begin: const Offset(0, -1), - end: Offset.zero, - ).animate(curve), - child: child, - ); - }, + Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => const NotificationsScreen(), + ), ); }, ),