File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed
core/data/src/main/kotlin/com/xayah/core/data/repository
feature/main/details/src/main/kotlin/com/xayah/feature/main/details Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -153,8 +153,8 @@ class AppsRepo @Inject constructor(
153
153
appsDao.blockByIds(ids)
154
154
}
155
155
156
- suspend fun setBlocked ( id : Long , blocked : Boolean ) {
157
- appsDao.setBlocked(id, blocked )
156
+ suspend fun blockByIds ( ids : List < Long > ) {
157
+ appsDao.blockByIds(ids )
158
158
}
159
159
160
160
suspend fun setEnabled (id : Long , enabled : Boolean ) {
Original file line number Diff line number Diff line change @@ -293,8 +293,8 @@ class FilesRepo @Inject constructor(
293
293
filesDao.upsert(file)
294
294
}
295
295
296
- suspend fun setBlocked ( id : Long , blocked : Boolean ) {
297
- filesDao.setBlocked(id, blocked )
296
+ suspend fun blockByIds ( ids : List < Long > ) {
297
+ filesDao.blockByIds(ids )
298
298
}
299
299
300
300
suspend fun delete (id : Long ) {
Original file line number Diff line number Diff line change @@ -173,17 +173,16 @@ class DetailsViewModel @Inject constructor(
173
173
when (uiState.value) {
174
174
is Success .App -> {
175
175
val state = uiState.value.castTo<Success .App >()
176
- appsRepo.setBlocked( state.app.id, blocked. not ( ))
176
+ appsRepo.blockByIds( listOf ( state.app.id))
177
177
}
178
178
179
179
is Success .File -> {
180
180
val state = uiState.value.castTo<Success .File >()
181
- filesRepo.setBlocked( state.file.id, blocked. not ( ))
181
+ filesRepo.blockByIds( listOf ( state.file.id))
182
182
}
183
183
184
184
else -> {}
185
185
}
186
-
187
186
}
188
187
}
189
188
You can’t perform that action at this time.
0 commit comments