Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix selection count displaying zero on first selection

ashilkn028f376911bf
diff --git a/mobile/apps/photos/CLAUDE.md b/mobile/apps/photos/CLAUDE.md
index a8a780b68b..080111a2cc 100644
--- a/mobile/apps/photos/CLAUDE.md
+++ b/mobile/apps/photos/CLAUDE.md
@@ -211,3 +211,4 @@ lib/
# Individual Preferences
- @~/.claude/ente-photos-instructions.md
+- do not prefix commit messages with "[mob][photos]"
\ No newline at end of file
diff --git a/mobile/apps/photos/lib/ui/components/bottom_action_bar/action_bar_widget.dart b/mobile/apps/photos/lib/ui/components/bottom_action_bar/action_bar_widget.dart
index 91c322d7ad..07a5aacfd4 100644
--- a/mobile/apps/photos/lib/ui/components/bottom_action_bar/action_bar_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/bottom_action_bar/action_bar_widget.dart
@@ -27,8 +27,11 @@ class _ActionBarWidgetState extends State<ActionBarWidget> {
@override
void initState() {
- widget.selectedFiles?.addListener(_selectedFilesListener);
super.initState();
+ widget.selectedFiles?.addListener(_selectedFilesListener);
+ // Sync initial state if files are already selected
+
+ _selectedFilesListener();
}
@override
@@ -94,7 +97,7 @@ class _ActionBarWidgetState extends State<ActionBarWidget> {
}
void _selectedFilesListener() {
- if (widget.selectedFiles!.files.isNotEmpty) {
+ if (widget.selectedFiles?.files.isNotEmpty ?? false) {
_selectedFilesNotifier.value = widget.selectedFiles!.files.length;
_selectedOwnedFilesNotifier.value = widget.selectedFiles!.files
.where((f) => f.ownerID == null || f.ownerID! == currentUserID)