TF-1645 Fix can not parse mail capability
(cherry picked from commit fcbe822f76f73cd237dd27069b5f77a1f6b02ff3)
This commit is contained in:
@@ -377,7 +377,7 @@ class EmailAPI with HandleSetErrorMixin {
|
||||
|
||||
final coreCapability = moveRequest.session.getCapabilityProperties<CoreCapability>(
|
||||
accountId, CapabilityIdentifier.jmapCore);
|
||||
final maxMethodCount = coreCapability.maxCallsInRequest.value.toInt();
|
||||
final maxMethodCount = coreCapability.maxCallsInRequest?.value.toInt() ?? 0;
|
||||
|
||||
var start = 0;
|
||||
var end = 0;
|
||||
|
||||
@@ -185,7 +185,7 @@ class MailboxAPI with HandleSetErrorMixin {
|
||||
|
||||
final coreCapability = session.getCapabilityProperties<CoreCapability>(
|
||||
accountId, CapabilityIdentifier.jmapCore);
|
||||
final maxMethodCount = coreCapability.maxCallsInRequest.value.toInt();
|
||||
final maxMethodCount = coreCapability.maxCallsInRequest?.value.toInt() ?? 0;
|
||||
|
||||
final Map<Id,SetError> finalDeletedMailboxErrors = {};
|
||||
var start = 0;
|
||||
|
||||
@@ -64,9 +64,14 @@ class QuotasController extends BaseController {
|
||||
void _handleGetQuotasSuccess(GetQuotasSuccess success) {
|
||||
try {
|
||||
final quotas = success.quotas.firstWhere((e) => e.resourceType == ResourceType.octets);
|
||||
usedCapacity.value = DoubleConvert.bytesToGigaBytes(quotas.used.value);
|
||||
warningLimitCapacity.value = DoubleConvert.bytesToGigaBytes(quotas.limit.value * warningProgressConstant);
|
||||
limitCapacity.value = DoubleConvert.bytesToGigaBytes(quotas.limit.value);
|
||||
if (quotas.used != null) {
|
||||
usedCapacity.value = DoubleConvert.bytesToGigaBytes(quotas.used!.value);
|
||||
}
|
||||
if (quotas.limit != null) {
|
||||
warningLimitCapacity.value = DoubleConvert.bytesToGigaBytes(quotas.limit!.value * warningProgressConstant);
|
||||
limitCapacity.value = DoubleConvert.bytesToGigaBytes(quotas.limit!.value);
|
||||
}
|
||||
|
||||
if(usedCapacity.value >= limitCapacity.value) {
|
||||
quotasState.value = QuotasState.runOutOfStorage;
|
||||
} else if (usedCapacity.value >= warningLimitCapacity.value) {
|
||||
|
||||
Reference in New Issue
Block a user