Add check for <= 0 time duration for Never case.

This commit is contained in:
Alex Hart
2025-06-26 14:26:18 -03:00
parent c75cafd5f5
commit bc10cd0d03

View File

@@ -446,14 +446,20 @@ private fun ActiveBackupsRow(
} }
} }
Text( val lastBackupString = if (lastBackupAt.inWholeMilliseconds > 0) {
text = stringResource(
R.string.BackupsSettingsFragment_last_backup_s,
DateUtils.getDatelessRelativeTimeSpanFormattedDate( DateUtils.getDatelessRelativeTimeSpanFormattedDate(
LocalContext.current, LocalContext.current,
Locale.getDefault(), Locale.getDefault(),
lastBackupAt.inWholeMilliseconds lastBackupAt.inWholeMilliseconds
).value ).value
} else {
stringResource(R.string.RemoteBackupsSettingsFragment__never)
}
Text(
text = stringResource(
R.string.BackupsSettingsFragment_last_backup_s,
lastBackupString
), ),
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
style = MaterialTheme.typography.bodyMedium style = MaterialTheme.typography.bodyMedium