feat(mobile): add the number of activities to the activity button label

This commit is contained in:
idubnori
2025-12-18 01:31:29 +09:00
parent 3e8635431e
commit d63a1bcd07
12 changed files with 50 additions and 29 deletions

View File

@@ -4,12 +4,12 @@ import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'activity_statistics.provider.g.dart';
// ignore: unintended_html_in_doc_comment
/// Maintains the current number of comments by <shared-album, asset>
/// Maintains the current number of activities (comments + likes) by <shared-album, asset>
@riverpod
class ActivityStatistics extends _$ActivityStatistics {
@override
int build(String albumId, [String? assetId]) {
ref.watch(activityServiceProvider).getStatistics(albumId, assetId: assetId).then((stats) => state = stats.comments);
ref.watch(activityServiceProvider).getStatistics(albumId, assetId: assetId).then((stats) => state = stats.total);
return 0;
}