mirror of
https://github.com/ProtonMail/android-mail.git
synced 2026-06-14 09:54:47 +00:00
Add safe fallback mapping for new Rust category-system values
- As part of the Rust bump, handle newly introduced category-related system folder values with a defensive fallback strategy. NOJIRA
This commit is contained in:
+4
@@ -151,6 +151,10 @@ fun MovableSystemFolder.toSystemLabel() = when (this) {
|
||||
MovableSystemFolder.TRASH -> SystemLabelId.Trash
|
||||
MovableSystemFolder.SPAM -> SystemLabelId.Spam
|
||||
MovableSystemFolder.ARCHIVE -> SystemLabelId.Archive
|
||||
else -> {
|
||||
Timber.w("rust-label: mapping from Inbox categories will be supported later. Fallback to Inbox")
|
||||
SystemLabelId.Inbox
|
||||
}
|
||||
}
|
||||
|
||||
fun InlineCustomLabel.toLabel() = Label(
|
||||
|
||||
+5
@@ -19,6 +19,7 @@
|
||||
package ch.protonmail.android.mailmessage.data.mapper
|
||||
|
||||
import ch.protonmail.android.mailcommon.domain.model.Action
|
||||
import timber.log.Timber
|
||||
import uniffi.mail_uniffi.MovableSystemFolder
|
||||
|
||||
fun MovableSystemFolder.toAction() = when (this) {
|
||||
@@ -26,4 +27,8 @@ fun MovableSystemFolder.toAction() = when (this) {
|
||||
MovableSystemFolder.SPAM -> Action.Spam
|
||||
MovableSystemFolder.ARCHIVE -> Action.Archive
|
||||
MovableSystemFolder.INBOX -> Action.Inbox
|
||||
else -> {
|
||||
Timber.w("Mapping from Inbox categories will be supported later. Fallback to Inbox")
|
||||
Action.Inbox
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user