Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] remove dead code and remove secondary confirm dialog

Priyanshu Dangare87089390f609
diff --git a/mobile/apps/photos/lib/ui/actions/file/file_actions.dart b/mobile/apps/photos/lib/ui/actions/file/file_actions.dart
index 66ca201c0a..d0c41d05e2 100644
--- a/mobile/apps/photos/lib/ui/actions/file/file_actions.dart
+++ b/mobile/apps/photos/lib/ui/actions/file/file_actions.dart
@@ -8,7 +8,6 @@ import "package:photos/events/details_sheet_event.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/models/file/extensions/file_props.dart";
import 'package:photos/models/file/file.dart';
-import 'package:photos/models/file/file_type.dart';
import "package:photos/service_locator.dart";
import "package:photos/services/media_store_service.dart";
import "package:photos/theme/ente_theme.dart";
@@ -37,8 +36,6 @@ Future<void> showSingleFileDeleteSheet(
useRootNavigator: Platform.isIOS,
builder: (_) => DeleteConfirmationSheet(
count: 1,
- hasPhotos: file.fileType != FileType.video,
- hasVideos: file.fileType == FileType.video,
isLocal: isLocal,
isRemote: false,
onDeleteFromLocal: () async {
@@ -75,8 +72,6 @@ Future<void> showSingleFileDeleteSheet(
isLocal: isLocal,
isRemote: isRemote,
count: 1,
- hasPhotos: file.fileType != FileType.video,
- hasVideos: file.fileType == FileType.video,
onDeleteFromLocal: () async {
final deletedFiles = await deleteFilesOnDeviceOnly(context, [file]);
if (deletedFiles.isNotEmpty &&
diff --git a/mobile/apps/photos/lib/utils/delete_file_util.dart b/mobile/apps/photos/lib/utils/delete_file_util.dart
index 68c95bd37f..64aade8761 100644
--- a/mobile/apps/photos/lib/utils/delete_file_util.dart
+++ b/mobile/apps/photos/lib/utils/delete_file_util.dart
@@ -62,15 +62,6 @@ Future<void> deleteFilesFromEverywhere(
hasLocalOnlyFiles = true;
}
}
- if (hasLocalOnlyFiles &&
- Platform.isAndroid &&
- !isLocalGalleryMode &&
- await MediaStoreService.canManageMedia()) {
- final shouldProceed = await shouldProceedWithDeletion(context);
- if (!shouldProceed) {
- return;
- }
- }
Set<String> deletedIDs = <String>{};
try {
deletedIDs = (await PhotoManager.editor.deleteWithIds(
@@ -230,15 +221,6 @@ Future<List<EnteFile>> deleteFilesOnDeviceOnly(
localOnlyIDs.add(file.localID);
}
}
- if (hasLocalOnlyFiles &&
- Platform.isAndroid &&
- !isLocalGalleryMode &&
- await MediaStoreService.canManageMedia()) {
- final shouldProceed = await shouldProceedWithDeletion(context);
- if (!shouldProceed) {
- return const [];
- }
- }
Set<String> deletedIDs = <String>{};
try {
deletedIDs = (await PhotoManager.editor.deleteWithIds(
@@ -764,21 +746,6 @@ Future<List<String>> _tryDeleteSharedMediaFiles(List<String> localIDs) {
}
}
-Future<bool> shouldProceedWithDeletion(BuildContext context) async {
- final actionResult = await showChoiceActionSheet(
- context,
- title: AppLocalizations.of(context).permanentlyDeleteFromDevice,
- body: AppLocalizations.of(context).someOfTheFilesYouAreTryingToDeleteAre,
- firstButtonLabel: AppLocalizations.of(context).delete,
- isCritical: true,
- );
- if (actionResult?.action == null) {
- return false;
- } else {
- return actionResult!.action == ButtonAction.first;
- }
-}
-
Future<void> showMediaManagementHintSheet(BuildContext context) async {
final l10n = AppLocalizations.of(context);
if (!Platform.isAndroid) {