Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix: review comments

Prateek Sunal88e0c6cdbfa5
diff --git a/mobile/apps/photos/lib/services/entity_service.dart b/mobile/apps/photos/lib/services/entity_service.dart
index 25793ac0d7..2fe2169cf8 100644
--- a/mobile/apps/photos/lib/services/entity_service.dart
+++ b/mobile/apps/photos/lib/services/entity_service.dart
@@ -80,12 +80,11 @@ class EntityService {
" ${id == null ? 'Adding' : 'Updating'} entity of type: " +
type.typeToString(),
);
- late LocalEntityData localData;
final EntityData data = id == null || addWithCustomID
? await _gateway.createEntity(type, id, encryptedData, header)
: await _gateway.updateEntity(type, id, encryptedData, header);
- localData = LocalEntityData(
+ final localData = LocalEntityData(
id: data.id,
type: type,
data: plainText,
diff --git a/mobile/apps/photos/lib/ui/actions/collection/collection_file_actions.dart b/mobile/apps/photos/lib/ui/actions/collection/collection_file_actions.dart
index 14846dac5e..2deb10cf2a 100644
--- a/mobile/apps/photos/lib/ui/actions/collection/collection_file_actions.dart
+++ b/mobile/apps/photos/lib/ui/actions/collection/collection_file_actions.dart
@@ -183,14 +183,14 @@ extension CollectionFileActions on CollectionActions {
}
Future<bool> addToCollection(
- BuildContext? context,
+ BuildContext context,
int collectionID,
bool showProgressDialog, {
List<EnteFile>? selectedFiles,
List<SharedMediaFile>? sharedFiles,
List<AssetEntity>? picketAssets,
}) async {
- ProgressDialog? dialog = showProgressDialog && context != null
+ ProgressDialog? dialog = showProgressDialog
? createProgressDialog(
context,
S.of(context).uploadingFilesToAlbum,
@@ -246,7 +246,7 @@ extension CollectionFileActions on CollectionActions {
final Collection? c =
CollectionsService.instance.getCollectionByID(collectionID);
if (c != null && c.owner.id != currentUserID) {
- if (!showProgressDialog && context != null) {
+ if (!showProgressDialog) {
dialog = createProgressDialog(
context,
S.of(context).uploadingFilesToAlbum,
@@ -291,9 +291,7 @@ extension CollectionFileActions on CollectionActions {
} catch (e, s) {
logger.severe("Failed to add to album", e, s);
await dialog?.hide();
- if (context != null) {
- await showGenericErrorDialog(context: context, error: e);
- }
+ await showGenericErrorDialog(context: context, error: e);
rethrow;
}
}