File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
app/src/main/java/com/infomaniak/mail/ui Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -346,9 +346,12 @@ class MainViewModel @Inject constructor(
346
346
private fun updateExternalMailInfo (mailbox : Mailbox ) = viewModelScope.launch(ioCoroutineContext) {
347
347
SentryLog .d(TAG , " Force refresh External Mail info" )
348
348
with (ApiRepository .getExternalMailInfo(mailbox.hostingId, mailbox.mailboxName)) {
349
- if (isSuccess() && data != null ) mailboxController.updateMailbox(mailbox.objectId) {
350
- it.externalMailFlagEnabled = data!! .externalMailFlagEnabled
351
- it.trustedDomains = data!! .trustedDomains.toRealmList()
349
+ if (! isSuccess()) return @launch
350
+ data?.let { externalMailInfo ->
351
+ mailboxController.updateMailbox(mailbox.objectId) {
352
+ it.externalMailFlagEnabled = externalMailInfo.externalMailFlagEnabled
353
+ it.trustedDomains = externalMailInfo.trustedDomains.toRealmList()
354
+ }
352
355
}
353
356
}
354
357
}
You can’t perform that action at this time.
0 commit comments