TF-1613 Implement handleSuccessViewState and handleFailureViewState for all controller
(cherry picked from commit 35e727e795bb3c44cc9c47e02542b5bdc3955fdd)
This commit is contained in:
@@ -45,22 +45,6 @@ class QuotasController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onDone() {
|
||||
viewState.value.fold(
|
||||
(failure) {
|
||||
if (failure is GetQuotasFailure) {
|
||||
logError('QuotasController::onDone():[GetQuotasFailure]: ${failure.exception}');
|
||||
}
|
||||
},
|
||||
(success) {
|
||||
if (success is GetQuotasSuccess) {
|
||||
_handleGetQuotasSuccess(success);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void _handleGetQuotasSuccess(GetQuotasSuccess success) {
|
||||
try {
|
||||
final quotas = success.quotas.firstWhere((e) => e.resourceType == ResourceType.octets);
|
||||
@@ -85,10 +69,6 @@ class QuotasController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
void covertBytesToGB() {
|
||||
|
||||
}
|
||||
|
||||
void _initWorker() {
|
||||
accountIdWorker = ever(mailboxDashBoardController.accountId, (accountId) {
|
||||
if (accountId is AccountId && mailboxDashBoardController.sessionCurrent!= null) {
|
||||
@@ -108,4 +88,12 @@ class QuotasController extends BaseController {
|
||||
accountIdWorker.call();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
@override
|
||||
void handleSuccessViewState(Success success) {
|
||||
super.handleSuccessViewState(success);
|
||||
if (success is GetQuotasSuccess) {
|
||||
_handleGetQuotasSuccess(success);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user