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