mirror of
https://github.com/twofas/2fas-android.git
synced 2024-11-21 17:59:50 +01:00
Fix about version
This commit is contained in:
parent
99e06b26de
commit
7684e2ec13
@ -43,7 +43,6 @@ internal fun AboutScreen(
|
||||
|
||||
ScreenContent(
|
||||
uiState = uiState,
|
||||
versionName = viewModel.versionName,
|
||||
onLicensesClick = openLicenses,
|
||||
onReviewClick = { viewModel.reviewDone() },
|
||||
onSendCrashLogsToggle = { viewModel.toggleSendCrashLogs() }
|
||||
@ -53,7 +52,6 @@ internal fun AboutScreen(
|
||||
@Composable
|
||||
private fun ScreenContent(
|
||||
uiState: AboutUiState,
|
||||
versionName: String,
|
||||
onLicensesClick: () -> Unit,
|
||||
onReviewClick: () -> Unit,
|
||||
onSendCrashLogsToggle: () -> Unit,
|
||||
@ -207,7 +205,7 @@ private fun ScreenContent(
|
||||
.padding(start = 24.dp, end = 16.dp)
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.settings__version, versionName),
|
||||
text = stringResource(id = R.string.settings__version, uiState.versionName),
|
||||
color = TwTheme.color.onSurfaceSecondary,
|
||||
style = TwTheme.typo.body3
|
||||
)
|
||||
|
@ -4,4 +4,5 @@ import com.twofasapp.data.session.domain.AppSettings
|
||||
|
||||
data class AboutUiState(
|
||||
val appSettings: AppSettings = AppSettings(),
|
||||
val versionName: String = ""
|
||||
)
|
||||
|
@ -29,14 +29,17 @@ internal class AboutViewModel(
|
||||
uiState.update { it.copy(appSettings = appSettings) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val versionName =
|
||||
if (appBuild.buildVariant != BuildVariant.Release) {
|
||||
"${appBuild.versionName} (${appBuild.buildVariant.name.camelCaseBeginLower()})"
|
||||
} else {
|
||||
appBuild.versionName
|
||||
uiState.update {
|
||||
it.copy(
|
||||
versionName = if (appBuild.buildVariant != BuildVariant.Release) {
|
||||
"${appBuild.versionName} (${appBuild.buildVariant.name.camelCaseBeginLower()})"
|
||||
} else {
|
||||
appBuild.versionName
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun reviewDone() {
|
||||
viewModelScope.launch(dispatchers.io) {
|
||||
|
Loading…
Reference in New Issue
Block a user