mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-29 21:22:15 +01:00
Add check for <= 0 time duration for Never case.
This commit is contained in:
@@ -446,14 +446,20 @@ private fun ActiveBackupsRow(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val lastBackupString = if (lastBackupAt.inWholeMilliseconds > 0) {
|
||||||
|
DateUtils.getDatelessRelativeTimeSpanFormattedDate(
|
||||||
|
LocalContext.current,
|
||||||
|
Locale.getDefault(),
|
||||||
|
lastBackupAt.inWholeMilliseconds
|
||||||
|
).value
|
||||||
|
} else {
|
||||||
|
stringResource(R.string.RemoteBackupsSettingsFragment__never)
|
||||||
|
}
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(
|
text = stringResource(
|
||||||
R.string.BackupsSettingsFragment_last_backup_s,
|
R.string.BackupsSettingsFragment_last_backup_s,
|
||||||
DateUtils.getDatelessRelativeTimeSpanFormattedDate(
|
lastBackupString
|
||||||
LocalContext.current,
|
|
||||||
Locale.getDefault(),
|
|
||||||
lastBackupAt.inWholeMilliseconds
|
|
||||||
).value
|
|
||||||
),
|
),
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
style = MaterialTheme.typography.bodyMedium
|
style = MaterialTheme.typography.bodyMedium
|
||||||
|
|||||||
Reference in New Issue
Block a user