switch to new image api strat and fix onboarding cache strat

This commit is contained in:
yaso 2026-07-07 14:30:58 +02:00
parent 48b434dad9
commit a5bdee892c
39 changed files with 540 additions and 791 deletions

View file

@ -75,6 +75,7 @@ class MzansiProfileProvider extends ChangeNotifier {
}
Future<bool> syncWithMihServerData() async {
await _hiveData.processModificationsQueue();
bool success = await _hiveData.syncProfileDataWithServer();
loadCachedProfileState();
return success;
@ -84,6 +85,24 @@ class MzansiProfileProvider extends ChangeNotifier {
refreshIndicatorKey.currentState?.show();
}
bool isLocalModificationsPending(){
return _hiveData.isModificationsNotEmpty();
}
Future<bool> addUserConsent(UserConsent newConsent) async {
bool success = await _hiveData.addUserConsentLocally(newConsent);
await _hiveData.queuAddConsentModification(newConsent);
await _hiveData.processModificationsQueue();
await _hiveData.syncProfileDataWithServer();
loadCachedProfileState();
return success;
}
Future<void> clearProfileCacheAndProvider() async {
await _hiveData.clearProfileCache();
reset();
}
void reset() {
personalHome = true;
personalIndex = 0;
@ -98,6 +117,10 @@ class MzansiProfileProvider extends ChangeNotifier {
businessUserSignatureUrl = null;
businessUserSignature = null;
userConsent = null;
employeeList = null;
userSearchResults = [];
personalLinks = [];
businessLinks = [];
notifyListeners();
}