Skip to content

armgit / ente

Public Imported from GitHub
0

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

Log stale gallery taps

Neeraj Gupta2d74d2677f85
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/component/gallery_file_widget.dart b/mobile/apps/photos/lib/ui/viewer/gallery/component/gallery_file_widget.dart
index 78950a2964..5ff6251b1e 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/component/gallery_file_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/component/gallery_file_widget.dart
@@ -3,6 +3,7 @@ import "dart:async";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:flutter/material.dart";
import "package:flutter/services.dart";
+import "package:logging/logging.dart";
import "package:media_extension/media_extension.dart";
import "package:media_extension/media_extension_action_types.dart";
import "package:photos/core/constants.dart";
@@ -47,6 +48,7 @@ class GalleryFileWidget extends StatefulWidget {
class _GalleryFileWidgetState extends State<GalleryFileWidget> {
static const borderRadius = BorderRadius.all(Radius.circular(1));
+ static final _logger = Logger("GalleryFileWidget");
late bool _isFileSelected;
int? _currentPointerId;
bool _isPointerInside = false;
@@ -289,6 +291,9 @@ class _GalleryFileWidgetState extends State<GalleryFileWidget> {
final selectedIndex = galleryFiles.indexOf(file);
// A refresh can make the tapped tile stale.
if (selectedIndex < 0) {
+ _logger.warning(
+ "Not opening viewer; tapped item is no longer in the gallery",
+ );
return;
}
// Device folders (local-only contexts) should keep files visible