switch to new image api strat and fix onboarding cache strat
This commit is contained in:
parent
48b434dad9
commit
a5bdee892c
39 changed files with 540 additions and 791 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue