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(
153153 appsDao.blockByIds(ids)
154154 }
155155
156- suspend fun setBlocked ( id : Long , blocked : Boolean ) {
157- appsDao.setBlocked(id, blocked )
156+ suspend fun blockByIds ( ids : List < Long > ) {
157+ appsDao.blockByIds(ids )
158158 }
159159
160160 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(
293293 filesDao.upsert(file)
294294 }
295295
296- suspend fun setBlocked ( id : Long , blocked : Boolean ) {
297- filesDao.setBlocked(id, blocked )
296+ suspend fun blockByIds ( ids : List < Long > ) {
297+ filesDao.blockByIds(ids )
298298 }
299299
300300 suspend fun delete (id : Long ) {
Original file line number Diff line number Diff line change @@ -173,17 +173,16 @@ class DetailsViewModel @Inject constructor(
173173 when (uiState.value) {
174174 is Success .App -> {
175175 val state = uiState.value.castTo<Success .App >()
176- appsRepo.setBlocked( state.app.id, blocked. not ( ))
176+ appsRepo.blockByIds( listOf ( state.app.id))
177177 }
178178
179179 is Success .File -> {
180180 val state = uiState.value.castTo<Success .File >()
181- filesRepo.setBlocked( state.file.id, blocked. not ( ))
181+ filesRepo.blockByIds( listOf ( state.file.id))
182182 }
183183
184184 else -> {}
185185 }
186-
187186 }
188187 }
189188
You can’t perform that action at this time.
0 commit comments