This commit is contained in:
2026-02-22 19:07:07 -05:00
parent c9a370a424
commit 1618588a30
5 changed files with 45 additions and 23 deletions

View File

@@ -29,6 +29,7 @@ export function DiscoverPage() {
(keyEvent: any) => {
const isDown = keybind.match("down", keyEvent);
const isUp = keybind.match("up", keyEvent);
const isCycle = keybind.match("cycle", keyEvent);
const isSelect = keybind.match("select", keyEvent);
if (isSelect) {
@@ -42,10 +43,12 @@ export function DiscoverPage() {
const filteredPodcasts = discoverStore.filteredPodcasts();
if (filteredPodcasts.length === 0) return;
if (isDown && showIndex() < filteredPodcasts.length - 1) {
setShowIndex(showIndex() + 1);
} else if (isUp && showIndex() > 0) {
setShowIndex(showIndex() - 1);
if (isDown) {
setShowIndex((i) => (i + 1) % filteredPodcasts.length);
} else if (isUp) {
setShowIndex((i) => (i - 1 + filteredPodcasts.length) % filteredPodcasts.length);
} else if (isCycle) {
setShowIndex((i) => (i + 1) % filteredPodcasts.length);
}
},
{ release: false },