Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix merge conflicts

AmanRajSinghMouryab62537809176
diff --git a/mobile/apps/locker/lib/l10n/app_localizations.dart b/mobile/apps/locker/lib/l10n/app_localizations.dart
index 23c9b547d8..f2548cf83f 100644
--- a/mobile/apps/locker/lib/l10n/app_localizations.dart
+++ b/mobile/apps/locker/lib/l10n/app_localizations.dart
@@ -2518,23 +2518,71 @@ abstract class AppLocalizations {
/// **'{used} / {max}'**
String fileCount(String used, String max);
- /// No description provided for @sorry.
+ /// No description provided for @favorite.
///
/// In en, this message translates to:
- /// **'Sorry'**
- String get sorry;
+ /// **'Favorite'**
+ String get favorite;
- /// No description provided for @subscribe.
+ /// No description provided for @unfavorite.
///
/// In en, this message translates to:
- /// **'Subscribe'**
- String get subscribe;
+ /// **'Unfavorite'**
+ String get unfavorite;
- /// No description provided for @subscriptionRequiredForSharing.
+ /// No description provided for @addingToFavorites.
///
/// In en, this message translates to:
- /// **'You need a paid subscription to share links'**
- String get subscriptionRequiredForSharing;
+ /// **'Adding to Favorites...'**
+ String get addingToFavorites;
+
+ /// No description provided for @removingFromFavorites.
+ ///
+ /// In en, this message translates to:
+ /// **'Removing from Favorites...'**
+ String get removingFromFavorites;
+
+ /// No description provided for @markingAsFavorites.
+ ///
+ /// In en, this message translates to:
+ /// **'Marking as Favorites...'**
+ String get markingAsFavorites;
+
+ /// No description provided for @fileMarkedAsFavorite.
+ ///
+ /// In en, this message translates to:
+ /// **'Item marked as favorite'**
+ String get fileMarkedAsFavorite;
+
+ /// No description provided for @fileRemovedFromFavorites.
+ ///
+ /// In en, this message translates to:
+ /// **'Item removed from favorites'**
+ String get fileRemovedFromFavorites;
+
+ /// Success message when items are marked as favorites
+ ///
+ /// In en, this message translates to:
+ /// **'{count, plural, =1{1 item marked as favorite} other{{count} items marked as favorites}}'**
+ String filesMarkedAsFavorites(int count);
+
+ /// No description provided for @allFilesAlreadyMarkedAsFavorites.
+ ///
+ /// In en, this message translates to:
+ /// **'All items are already marked as favorites'**
+ String get allFilesAlreadyMarkedAsFavorites;
+
+ /// Error message when marking items as favorites fails
+ ///
+ /// In en, this message translates to:
+ /// **'Failed to mark items as favorites: {error}'**
+ String failedToMarkFilesAsFavorites(String error);
+
+ /// Error message when updating favorite status fails
+ ///
+ /// In en, this message translates to:
+ /// **'Failed to update favorite status: {error}'**
+ String failedToUpdateFavoriteStatus(String error);
}
class _AppLocalizationsDelegate
diff --git a/mobile/apps/locker/lib/l10n/app_localizations_en.dart b/mobile/apps/locker/lib/l10n/app_localizations_en.dart
index bd5ec63110..df75585ed7 100644
--- a/mobile/apps/locker/lib/l10n/app_localizations_en.dart
+++ b/mobile/apps/locker/lib/l10n/app_localizations_en.dart
@@ -1466,12 +1466,48 @@ class AppLocalizationsEn extends AppLocalizations {
}
@override
- String get sorry => 'Sorry';
+ String get favorite => 'Favorite';
@override
- String get subscribe => 'Subscribe';
+ String get unfavorite => 'Unfavorite';
@override
- String get subscriptionRequiredForSharing =>
- 'You need a paid subscription to share links';
+ String get addingToFavorites => 'Adding to Favorites...';
+
+ @override
+ String get removingFromFavorites => 'Removing from Favorites...';
+
+ @override
+ String get markingAsFavorites => 'Marking as Favorites...';
+
+ @override
+ String get fileMarkedAsFavorite => 'Item marked as favorite';
+
+ @override
+ String get fileRemovedFromFavorites => 'Item removed from favorites';
+
+ @override
+ String filesMarkedAsFavorites(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count items marked as favorites',
+ one: '1 item marked as favorite',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get allFilesAlreadyMarkedAsFavorites =>
+ 'All items are already marked as favorites';
+
+ @override
+ String failedToMarkFilesAsFavorites(String error) {
+ return 'Failed to mark items as favorites: $error';
+ }
+
+ @override
+ String failedToUpdateFavoriteStatus(String error) {
+ return 'Failed to update favorite status: $error';
+ }
}
diff --git a/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart b/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart
index ba54c4c43e..3366889ebc 100644
--- a/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart
@@ -105,8 +105,7 @@ class FilePopupMenuWidget extends StatelessWidget {
color: colorScheme.textBase,
size: 20,
),
- label:
- isFavorite ? context.l10n.unfavorite : context.l10n.favorite,
+ label: isFavorite ? "Unimportant" : "Important",
isFirst: false,
isLast: false,
);
diff --git a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
index 50c6a5c2a3..401e8d157d 100644
--- a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
+++ b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
@@ -35,26 +35,11 @@ class FileSelectionOverlayBar extends StatefulWidget {
class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
static final Logger _logger = Logger("FileSelectionOverlayBar");
- bool _isFavorite = false;
@override
void initState() {
super.initState();
widget.selectedFiles.addListener(_onSelectionChanged);
- _checkIfFavorite();
- }
-
- Future<void> _checkIfFavorite() async {
- if (widget.selectedFiles.files.length == 1) {
- final file = widget.selectedFiles.files.first;
- final isFav = await FileActions.isFavorite(file);
-
- if (mounted) {
- setState(() {
- _isFavorite = isFav;
- });
- }
- }
}
@override
@@ -66,7 +51,6 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
void _onSelectionChanged() {
if (mounted) {
setState(() {});
- _checkIfFavorite();
}
}
@@ -363,25 +347,6 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
onTap: () => _editFile(context, file!),
),
);
- actions.add(
- SelectionActionButton(
- hugeIcon: const HugeIcon(
- icon: HugeIcons.strokeRoundedStar,
- ),
- label: _isFavorite ? context.l10n.unfavorite : context.l10n.favorite,
- onTap: () => _toggleFavorite(context, file!),
- ),
- );
- } else {
- actions.add(
- SelectionActionButton(
- hugeIcon: const HugeIcon(
- icon: HugeIcons.strokeRoundedStar,
- ),
- label: context.l10n.favorite,
- onTap: () => _markMultipleAsFavorites(context, files),
- ),
- );
}
actions.add(
@@ -637,31 +602,4 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
}
}
- Future<void> _toggleFavorite(BuildContext context, EnteFile file) async {
- await FileActions.toggleFavorite(
- context,
- file,
- onSuccess: () {
- widget.selectedFiles.clearAll();
- if (mounted) {
- setState(() {
- _isFavorite = !_isFavorite;
- });
- }
- },
- );
- }
-
- Future<void> _markMultipleAsFavorites(
- BuildContext context,
- List<EnteFile> files,
- ) async {
- await FileActions.markMultipleAsImportant(
- context,
- files,
- onSuccess: () {
- widget.selectedFiles.clearAll();
- },
- );
- }
}