π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mobile][photos] use trash file boolean getters
Priyanshu Dangared7dcabb5d82d
diff --git a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dartindex e2189f2c4f..8446009587 100644--- a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart+++ b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart@@ -1093,7 +1093,7 @@ class _FileSelectionActionsWidgetStatevoid _restore() {final isSystemOnly = widget.selectedFiles.files.every(- (f) => f.asTrashFile!.isSystemOnly,+ (f) => f.isSystemOnlyTrashFile,);if (isSystemOnly) {_restoreFilesFromSystemTrash(widget.selectedFiles).onError((e, s) {@@ -1111,7 +1111,7 @@ class _FileSelectionActionsWidgetStateFuture<void> _permanentlyDeleteFromTrash() async {final isSystemOnly = widget.selectedFiles.files.every(- (f) => f.asTrashFile!.isSystemOnly,+ (f) => f.isSystemOnlyTrashFile,);if (isSystemOnly) {await permanentlyDeleteFromSystemTrash(context, widget.selectedFiles);diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dartindex b1afdfb2a3..52d74e432d 100644--- a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart+++ b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart@@ -290,7 +290,7 @@ class FileAppBarState extends State<FileAppBar> {}if (!isFileUploaded &&- widget.file.asTrashFile == null &&+ !widget.file.isTrashFile &&!isLocalGalleryMode) {_actions.add(UploadIconWidget(file: widget.file, key: ValueKey(widget.file.tag)),diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dart b/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dartindex e12c808402..c17e1c89df 100644--- a/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dart+++ b/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dart@@ -242,7 +242,7 @@ class FileBottomBarState extends State<FileBottomBar> {child: IconButton(icon: const Icon(CupertinoIcons.gobackward, color: Colors.white),onPressed: () {- if (widget.file.asTrashFile!.isSystemOnly) {+ if (widget.file.isSystemOnlyTrashFile) {_restoreFromSystemTrash().onError((e, s) {if (!mounted) return;showGenericErrorDialog(context: context, error: e).ignore();diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_details_widget.dart b/mobile/apps/photos/lib/ui/viewer/file/file_details_widget.dartindex 5e562545ef..f0e4fa99b8 100644--- a/mobile/apps/photos/lib/ui/viewer/file/file_details_widget.dart+++ b/mobile/apps/photos/lib/ui/viewer/file/file_details_widget.dart@@ -77,7 +77,6 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {@overridevoid initState() {debugPrint('file_details_sheet initState');- final isSystemTrashFile = widget.file.asTrashFile?.isSystemOnly ?? false;_currentUserID = Configuration.instance.getUserIDV2();hasLocationData.value = widget.file.hasLocation;_isImage =@@ -104,7 +103,7 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {}});- if (!isSystemTrashFile) {+ if (!widget.file.isSystemOnlyTrashFile) {if (_isImage) {_exifNotifier.addListener(() {if (_exifNotifier.value != null) {@@ -153,7 +152,6 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {@overrideWidget build(BuildContext context) {final file = widget.file;- final isSystemTrashFile = file.asTrashFile?.isSystemOnly ?? false;final bool isFileOwner =file.ownerID == null || file.ownerID == _currentUserID;@@ -233,7 +231,7 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {]);}- if (_isImage && !isSystemTrashFile) {+ if (_isImage && !file.isSystemOnlyTrashFile) {fileDetailsTiles.addAll([MenuGroupComponent(items: [@@ -262,7 +260,7 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {_exifData,_currentUserID,),- if (flagService.internalUser && !isSystemTrashFile)+ if (flagService.internalUser && !file.isSystemOnlyTrashFile)ValueListenableBuilder(valueListenable: _videoMetadataNotifier,builder: (context, value, _) => VideoExifRowItem(file, value),diff --git a/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart b/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dartindex e06731a378..40997deb59 100644--- a/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart+++ b/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart@@ -391,7 +391,7 @@ class _ZoomableImageState extends State<ZoomableImage> {if (!_loadingFinalImage &&!_loadedFinalImage &&- !(_photo.asTrashFile?.isSystemOnly ?? false)) {+ !_photo.isSystemOnlyTrashFile) {_loadingFinalImage = true;getFile(_photo,