mirror of
https://github.com/twofas/2fas-android.git
synced 2024-11-22 02:09:58 +01:00
Fix null values in advanced settings
This commit is contained in:
parent
efe4dc8bd2
commit
3d6d376840
@ -58,6 +58,10 @@ data class Service(
|
||||
}
|
||||
|
||||
companion object {
|
||||
val DefaultAlgorithm = Algorithm.SHA1
|
||||
const val DefaultPeriod = 30
|
||||
const val DefaultDigits = 6
|
||||
|
||||
val Empty = Service(
|
||||
id = 0L,
|
||||
serviceTypeId = null,
|
||||
|
@ -15,9 +15,8 @@ import com.twofasapp.designsystem.TwTheme
|
||||
import com.twofasapp.designsystem.common.TwTopAppBar
|
||||
import com.twofasapp.designsystem.settings.SettingsDivider
|
||||
import com.twofasapp.designsystem.settings.SettingsLink
|
||||
import com.twofasapp.locale.TwLocale
|
||||
import com.twofasapp.locale.R
|
||||
import com.twofasapp.feature.home.ui.editservice.EditServiceViewModel
|
||||
import com.twofasapp.locale.TwLocale
|
||||
|
||||
@Composable
|
||||
internal fun AdvancedSettingsScreen(
|
||||
@ -74,7 +73,7 @@ internal fun AdvancedSettingsScreen(
|
||||
item {
|
||||
SettingsLink(
|
||||
title = TwLocale.strings.addManualAlgorithm,
|
||||
subtitle = service.algorithm?.name.orEmpty(),
|
||||
subtitle = service.algorithm?.name ?: Service.DefaultAlgorithm.name,
|
||||
enabled = false,
|
||||
)
|
||||
}
|
||||
@ -83,7 +82,7 @@ internal fun AdvancedSettingsScreen(
|
||||
item {
|
||||
SettingsLink(
|
||||
title = TwLocale.strings.addManualRefreshTime,
|
||||
subtitle = service.period.toString(),
|
||||
subtitle = (service.period ?: Service.DefaultPeriod).toString(),
|
||||
enabled = false,
|
||||
)
|
||||
}
|
||||
@ -102,7 +101,7 @@ internal fun AdvancedSettingsScreen(
|
||||
item {
|
||||
SettingsLink(
|
||||
title = TwLocale.strings.addManualDigits,
|
||||
subtitle = service.digits.toString(),
|
||||
subtitle = (service.digits ?: Service.DefaultDigits).toString(),
|
||||
enabled = false,
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user