From 76084f23da91fb5a4c486c45ab0abadd5173aa27 Mon Sep 17 00:00:00 2001 From: Kevin McDermott-Carpenter Date: Mon, 21 Oct 2024 23:12:22 +0100 Subject: [PATCH] fix: notifications not shown --- lib/services/sync/sync_service.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/services/sync/sync_service.dart b/lib/services/sync/sync_service.dart index 7b807a3..67296bc 100644 --- a/lib/services/sync/sync_service.dart +++ b/lib/services/sync/sync_service.dart @@ -177,7 +177,7 @@ class SyncService extends StateNotifier { } final name = userMap[asset.ownerId] ?? 'unknown'; - final count = map[name] ?? AssetCount(); + final count = map[name] ??= AssetCount(); switch (asset.type) { case AssetType.image: @@ -219,7 +219,6 @@ class SyncService extends StateNotifier { } if (newActivity.isNotEmpty) { - _logger.info('Sending activity notification'); _notifyActivity(newActivity); } @@ -275,13 +274,14 @@ class SyncService extends StateNotifier { continue; } - final count = map[event.user.name] ?? ActivityCount(); + final count = map[event.user.name] ??= ActivityCount(); // TODO: Should we separate asset types? // This would involve looking up each asset in the db. // Maybe only do this if there is only a small number of activity. switch (event.type) { case ActivityType.like: count.otherLikes++; + break; case ActivityType.comment: count.otherComments++; break; @@ -299,6 +299,8 @@ class SyncService extends StateNotifier { entry.value.describe(buf, entry.key, locale); } + _logger.info('Sending activity notification'); + await _notifications.activity( title: locale.newActivityNotification, content: buf.toString(),