Clamp image selector navigation

This commit is contained in:
Ryan Hughes
2026-05-11 15:52:38 -04:00
parent 693a23c58c
commit ca0ea7af57
+3 -2
View File
@@ -56,8 +56,9 @@ ShellRoot {
function select(index, immediate) {
if (imageModel.count === 0) return
if (index < 0) index = imageModel.count - 1
else if (index >= imageModel.count) index = 0
if (index < 0) index = 0
else if (index >= imageModel.count) index = imageModel.count - 1
if (index === selectedIndex && immediate !== true) return
animateSelection = immediate !== true
selectedIndex = index