π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Limit like failure toast visibility
ashilkn0ca9981ae825
diff --git a/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart b/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dartindex af352082be..b0f7580485 100644--- a/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart+++ b/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart@@ -1,4 +1,5 @@import "package:ente_icons/ente_icons.dart";+import "package:flutter/foundation.dart";import "package:flutter/material.dart";import "package:logging/logging.dart";import "package:photos/core/constants.dart";@@ -8,6 +9,7 @@ import "package:photos/models/collection/collection.dart";import "package:photos/models/file/extensions/file_props.dart";import "package:photos/models/file/file.dart";import "package:photos/models/social/social_data_provider.dart";+import "package:photos/service_locator.dart";import "package:photos/theme/ente_theme.dart";import "package:photos/ui/common/loading_widget.dart";import "package:photos/ui/components/buttons/icon_button_widget.dart";@@ -137,10 +139,12 @@ class _LikeCollectionSelectorSheetState_logger.severe("Failed to toggle like", e);if (mounted) {setState(() => state.isLiked = previousState);- showShortToast(- context,- AppLocalizations.of(context).failedToUpdateLike,- );+ if (flagService.internalUser || kDebugMode) {+ showShortToast(+ context,+ AppLocalizations.of(context).failedToUpdateLike,+ );+ }}}}diff --git a/mobile/apps/photos/lib/ui/social/widgets/file_social_overlay.dart b/mobile/apps/photos/lib/ui/social/widgets/file_social_overlay.dartindex 1c26adcbaa..e15e2a4b3e 100644--- a/mobile/apps/photos/lib/ui/social/widgets/file_social_overlay.dart+++ b/mobile/apps/photos/lib/ui/social/widgets/file_social_overlay.dart@@ -4,6 +4,7 @@ import "dart:math" as math;import "package:collection/collection.dart";import "package:ente_components/theme/text_styles.dart" as component;import "package:ente_icons/ente_icons.dart";+import "package:flutter/foundation.dart";import "package:flutter/material.dart";import "package:logging/logging.dart";import "package:photos/generated/l10n.dart";@@ -13,6 +14,7 @@ import "package:photos/models/file/file.dart";import "package:photos/models/social/comment.dart";import "package:photos/models/social/comment_author_utils.dart";import "package:photos/models/social/social_data_provider.dart";+import "package:photos/service_locator.dart";import "package:photos/services/collections_service.dart";import "package:photos/ui/notification/toast.dart";import "package:photos/ui/sharing/user_avator_widget.dart";@@ -222,10 +224,7 @@ class _FileSocialOverlayState extends State<FileSocialOverlay> {_logger.warning("Failed to like photo", error, stackTrace);if (mounted && widget.file.uploadedFileID == fileID) {setState(() => _hasLiked = previousState);- showShortToast(- context,- AppLocalizations.of(context).failedToUpdateLike,- );+ _showFailedToUpdateLikeToast();}}return;@@ -279,10 +278,7 @@ class _FileSocialOverlayState extends State<FileSocialOverlay> {if (failedCount > 0 && mounted && widget.file.uploadedFileID == fileID) {setState(() => _hasLiked = previousState);- showShortToast(- context,- AppLocalizations.of(context).failedToUpdateLike,- );+ _showFailedToUpdateLikeToast();}} catch (error, stackTrace) {_logger.warning(@@ -292,14 +288,17 @@ class _FileSocialOverlayState extends State<FileSocialOverlay> {);if (mounted && widget.file.uploadedFileID == fileID) {setState(() => _hasLiked = previousState);- showShortToast(- context,- AppLocalizations.of(context).failedToUpdateLike,- );+ _showFailedToUpdateLikeToast();}}}+ void _showFailedToUpdateLikeToast() {+ if (flagService.internalUser || kDebugMode) {+ showShortToast(context, AppLocalizations.of(context).failedToUpdateLike);+ }+ }+Future<void> _showLikes() async {final fileID = widget.file.uploadedFileID;if (fileID == null) return;