From efb1170b44c9edebeeb280d155cb80fc68df6906 Mon Sep 17 00:00:00 2001 From: laurenspriem Date: Wed, 24 Apr 2024 08:39:45 +0530 Subject: [PATCH] [mob][photos] unawait network call when accepting suggestion --- mobile/lib/services/entity_service.dart | 2 +- .../face_ml/person/person_service.dart | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mobile/lib/services/entity_service.dart b/mobile/lib/services/entity_service.dart index ba4b4a636..6ffe87358 100644 --- a/mobile/lib/services/entity_service.dart +++ b/mobile/lib/services/entity_service.dart @@ -61,7 +61,7 @@ class EntityService { }) async { final key = await getOrCreateEntityKey(type); final encryptedKeyData = await CryptoUtil.encryptChaCha( - utf8.encode(plainText) as Uint8List, + utf8.encode(plainText), key, ); final String encryptedData = diff --git a/mobile/lib/services/machine_learning/face_ml/person/person_service.dart b/mobile/lib/services/machine_learning/face_ml/person/person_service.dart index 509862abc..da6289953 100644 --- a/mobile/lib/services/machine_learning/face_ml/person/person_service.dart +++ b/mobile/lib/services/machine_learning/face_ml/person/person_service.dart @@ -1,3 +1,4 @@ +import "dart:async" show unawaited; import "dart:convert"; import "package:flutter/foundation.dart"; @@ -102,10 +103,12 @@ class PersonService { faces: faceIds.toSet(), ); personData.assigned!.add(clusterInfo); - await entityService.addOrUpdate( - EntityType.person, - json.encode(personData.toJson()), - id: personID, + unawaited( + entityService.addOrUpdate( + EntityType.person, + json.encode(personData.toJson()), + id: personID, + ), ); await faceMLDataDB.assignClusterToPerson( personID: personID,