mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-05-14 02:50:46 +00:00
add search route
This commit is contained in:
parent
0b601010e2
commit
a9ff0f6365
1 changed files with 2 additions and 2 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useGamepad } from '../GamepadContext';
|
import { useGamepad } from '../GamepadContext';
|
||||||
|
|
||||||
const ROUTES = ['board', 'discover', 'library', 'calendar', 'addons', 'settings'];
|
const ROUTES = ['search', 'board', 'discover', 'library', 'calendar', 'addons', 'settings'];
|
||||||
|
|
||||||
const useVerticalGamepadNavigation = (_sectionRef: React.RefObject<HTMLDivElement>, currentRoute: string) => {
|
const useVerticalGamepadNavigation = (_sectionRef: React.RefObject<HTMLDivElement>, currentRoute: string) => {
|
||||||
const gamepad = useGamepad();
|
const gamepad = useGamepad();
|
||||||
|
|
@ -18,7 +18,7 @@ const useVerticalGamepadNavigation = (_sectionRef: React.RefObject<HTMLDivElemen
|
||||||
if (direction === 'prev') nextIndex = Math.max(currentIndex - 1, 0);
|
if (direction === 'prev') nextIndex = Math.max(currentIndex - 1, 0);
|
||||||
|
|
||||||
if (nextIndex !== currentIndex) {
|
if (nextIndex !== currentIndex) {
|
||||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: String(nextIndex + 1), code: `Digit${nextIndex + 1}`, bubbles: true }));
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: String(nextIndex), code: `Digit${nextIndex}`, bubbles: true }));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue