fix(settings): reset drag state before restoring default bottom bar

Tapping Restore Default mid-drag would replace `items` with the default
list while `draggedItemIndex` still pointed into the old list. If the
old index exceeded the new list's lastIndex, the next pointer event
indexed `items` out of bounds. Clear drag state before save().

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
davotoula
2026-05-01 11:05:10 +02:00
parent c8818ed317
commit 86698dc3df
@@ -147,7 +147,11 @@ fun BottomBarSettingsContent(accountViewModel: AccountViewModel) {
horizontalArrangement = Arrangement.End,
) {
TextButton(
onClick = { save(initialRows(DefaultBottomBarItems)) },
onClick = {
draggedItemIndex = -1
dragOffset = 0f
save(initialRows(DefaultBottomBarItems))
},
) {
Text(stringRes(R.string.bottom_bar_settings_restore_default))
}