Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Fix selection bug when not logged in

ashilkndaaa685a3e6a
diff --git a/mobile/lib/ui/components/bottom_action_bar/action_bar_widget.dart b/mobile/lib/ui/components/bottom_action_bar/action_bar_widget.dart
index 9dc9e03298..f9b1492dee 100644
--- a/mobile/lib/ui/components/bottom_action_bar/action_bar_widget.dart
+++ b/mobile/lib/ui/components/bottom_action_bar/action_bar_widget.dart
@@ -21,7 +21,9 @@ class ActionBarWidget extends StatefulWidget {
class _ActionBarWidgetState extends State<ActionBarWidget> {
final ValueNotifier<int> _selectedFilesNotifier = ValueNotifier(0);
final ValueNotifier<int> _selectedOwnedFilesNotifier = ValueNotifier(0);
- final int currentUserID = Configuration.instance.getUserID()!;
+
+ //User ID will be null if the user is not logged in (links-in-app)
+ final int currentUserID = Configuration.instance.getUserID() ?? -1;
@override
void initState() {
diff --git a/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart
index ef15286dba..00c06bb2ef 100644
--- a/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart
+++ b/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart
@@ -89,7 +89,8 @@ class _FileSelectionActionsWidgetState
@override
void initState() {
- currentUserID = Configuration.instance.getUserID()!;
+ //User ID will be null if the user is not logged in (links-in-app)
+ currentUserID = Configuration.instance.getUserID() ?? -1;
split = FilesSplit.split(<EnteFile>[], currentUserID);
widget.selectedFiles.addListener(_selectFileChangeListener);