mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 03:32:38 +08:00
perf: longPressDraggableHandle
This commit is contained in:
parent
5e58901aa6
commit
2eb76cd1cd
|
@ -293,7 +293,7 @@ fun useSubsManagePage(): ScaffoldExt {
|
|||
)
|
||||
Card(
|
||||
modifier = Modifier
|
||||
.draggableHandle(onDragStopped = {
|
||||
.longPressDraggableHandle(onDragStopped = {
|
||||
val changeItems = mutableListOf<SubsItem>()
|
||||
orderSubItems.forEachIndexed { i, subsItem ->
|
||||
if (subItems[i] != subsItem) {
|
||||
|
@ -305,7 +305,9 @@ fun useSubsManagePage(): ScaffoldExt {
|
|||
}
|
||||
}
|
||||
if (orderSubItems.isNotEmpty()) {
|
||||
DbSet.subsItemDao.update(*changeItems.toTypedArray())
|
||||
vm.viewModelScope.launchTry {
|
||||
DbSet.subsItemDao.update(*changeItems.toTypedArray())
|
||||
}
|
||||
}
|
||||
})
|
||||
.shadow(elevation)
|
||||
|
|
Loading…
Reference in New Issue
Block a user