Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Sep 30, 2024
1 parent ec758e8 commit 9f489ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ class RefreshController @Inject constructor(
folder.unreadCountLocal = unreadCount

if (folder.role == FolderRole.INBOX) {
mailboxController.updateMailbox(mailbox.objectId) { mailbox ->
mailbox.unreadCountLocal = unreadCount
mailboxController.updateMailbox(mailbox.objectId) {
it.unreadCountLocal = unreadCount
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class PermissionsController @Inject constructor(
private val mailboxController: MailboxController,
) {

//region Get data
fun getPermissionsAsync(mailboxObjectId: String): Flow<MailboxPermissions?> {
return mailboxController.getMailboxAsync(mailboxObjectId).map { it.obj?.permissions }
}
//endregion
}
4 changes: 2 additions & 2 deletions app/src/main/java/com/infomaniak/mail/utils/SharedUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ class SharedUtils @Inject constructor(
fun updateFeatureFlags(mailboxObjectId: String, mailboxUuid: String) {
with(ApiRepository.getFeatureFlags(mailboxUuid)) {
if (isSuccess()) {
mailboxController.updateMailbox(mailboxObjectId) { mailbox ->
mailbox.featureFlags.setFeatureFlags(featureFlags = data ?: emptyList())
mailboxController.updateMailbox(mailboxObjectId) {
it.featureFlags.setFeatureFlags(featureFlags = data ?: emptyList())
}
}
}
Expand Down

0 comments on commit 9f489ce

Please sign in to comment.