mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-2795 Date as an object | Move to bin by right-to-left swipe (#1883)
This commit is contained in:
parent
cc970f3a3f
commit
c0439ba497
11 changed files with 262 additions and 14 deletions
|
@ -656,9 +656,22 @@ class CollectionViewModel(
|
|||
}
|
||||
|
||||
private fun changeObjectListBinStatus(ids: List<Id>, isArchived: Boolean) {
|
||||
launch {
|
||||
setObjectListIsArchived.stream(SetObjectListIsArchived.Params(ids, isArchived))
|
||||
.collect { it.progressiveFold() }
|
||||
viewModelScope.launch {
|
||||
val params = SetObjectListIsArchived.Params(ids, isArchived)
|
||||
setObjectListIsArchived.async(params)
|
||||
.fold(
|
||||
onSuccess = {
|
||||
if (isArchived) {
|
||||
toasts.emit("Objects moved to bin")
|
||||
} else {
|
||||
toasts.emit("Objects restored")
|
||||
}
|
||||
},
|
||||
onFailure = {
|
||||
toasts.emit("Error while moving files to bin")
|
||||
Timber.e(it, "Error while moving files to bin")
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue