mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Fix crash when using .max function
This commit is contained in:
@@ -64,7 +64,7 @@ class BackupPresenter @Inject constructor(
|
||||
.distinctUntilChanged()
|
||||
.switchMap { backupRepo.getBackups() }
|
||||
.doOnNext { backups -> newState { copy(backups = backups) } }
|
||||
.map { backups -> backups.map { it.date }.max() ?: 0L }
|
||||
.map { backups -> backups.maxOfOrNull { it.date } ?: 0L }
|
||||
.map { lastBackup ->
|
||||
when (lastBackup) {
|
||||
0L -> context.getString(R.string.backup_never)
|
||||
|
||||
Reference in New Issue
Block a user