Skip to content

Commit

Permalink
fix(TransferType): Use name instead of value
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinperignon committed Nov 13, 2024
1 parent 84229a2 commit 4871ea9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
*/
package com.infomaniak.multiplatform_swisstransfer.common.models

enum class TransferType(val value: String) {
LINK("link"),
QR_CODE("qrcode"),
PROXIMITY("proximity"),
MAIL("mail")
}
enum class TransferType {
LINK,
QR_CODE,
PROXIMITY,
MAIL,
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ class AppSettingsDB : RealmObject, AppSettings {
_emailLanguage = value.value
}

private var _lastTransferType: String = DEFAULT_TRANSFER_TYPE.value
private var _lastTransferType: String = DEFAULT_TRANSFER_TYPE.name
override var lastTransferType: TransferType
get() = TransferType.entries.find { it.value == _lastTransferType } ?: DEFAULT_TRANSFER_TYPE
get() = TransferType.entries.find { it.name == _lastTransferType } ?: DEFAULT_TRANSFER_TYPE
set(value) {
_lastTransferType = value.value
_lastTransferType = value.name
}

companion object {
Expand Down

0 comments on commit 4871ea9

Please sign in to comment.