Skip to content

Commit 0dbfda0

Browse files
committed
Improve code
1 parent 25843ae commit 0dbfda0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/src/main/java/com/phpbg/easysync/ui/MainViewModel.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,13 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
101101
}
102102

103103
val jobCount = FullSyncWorker.getAllLiveData(this.getApplication()).map { x ->
104-
return@map x.filter {
104+
return@map x.count {
105105
it.state in arrayOf(
106106
WorkInfo.State.RUNNING,
107107
WorkInfo.State.ENQUEUED,
108108
WorkInfo.State.BLOCKED
109109
)
110110
}
111-
.count()
112111
}
113112

114113
fun load() {

0 commit comments

Comments
 (0)