Skip to content

Commit 1c5a9f5

Browse files
TommyDL-InfomaniakKevinBoulongne
authored andcommitted
Apply suggestions
1 parent a52dea8 commit 1c5a9f5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

app/src/main/java/com/infomaniak/mail/data/cache/RealmDatabase.kt

+7-7
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ object RealmDatabase {
8989
val mailboxInfo get() = Realm.open(RealmConfig.mailboxInfo)
9090

9191
val newMailboxContentInstance get() = newMailboxContentInstance(AccountUtils.currentUserId, AccountUtils.currentMailboxId)
92-
fun newMailboxContentInstance(userId: Int, mailboxId: Int) = Realm.open(RealmConfig.mailboxContent(mailboxId, userId))
92+
fun newMailboxContentInstance(userId: Int, mailboxId: Int) = Realm.open(RealmConfig.mailboxContent(userId, mailboxId))
9393

9494
class MailboxContent {
9595
operator fun invoke() = runBlocking(Dispatchers.IO) {
@@ -142,7 +142,7 @@ object RealmDatabase {
142142

143143
//region Delete Realm
144144
fun deleteMailboxContent(mailboxId: Int, userId: Int = AccountUtils.currentUserId) {
145-
Realm.deleteRealm(RealmConfig.mailboxContent(mailboxId, userId))
145+
Realm.deleteRealm(RealmConfig.mailboxContent(userId, mailboxId))
146146
}
147147

148148
fun removeUserData(context: Context, userId: Int) {
@@ -232,11 +232,11 @@ object RealmDatabase {
232232
.migration(MAILBOX_INFO_MIGRATION)
233233
.build()
234234

235-
fun mailboxContent(mailboxId: Int, userId: Int): RealmConfiguration {
236-
if (mailboxId == DEFAULT_ID) Sentry.captureMessage(
237-
"RealmConfiguration problem with mailbox content, default ID is used.",
238-
SentryLevel.ERROR
239-
)
235+
fun mailboxContent(userId: Int, mailboxId: Int): RealmConfiguration {
236+
237+
if (mailboxId == DEFAULT_ID) {
238+
Sentry.captureMessage("RealmConfiguration problem with mailbox content, default ID is used.", SentryLevel.ERROR)
239+
}
240240

241241
return RealmConfiguration.Builder(mailboxContentSet)
242242
.name(mailboxContentDbName(userId, mailboxId))

0 commit comments

Comments
 (0)