mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-09 03:37:45 +03:00
feat: adding user tags
This commit is contained in:
parent
e78de55fe7
commit
a557bbb948
@ -23,6 +23,8 @@ import { steamUserTags } from "./steam-user-tags";
|
|||||||
export default function Catalogue() {
|
export default function Catalogue() {
|
||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
|
const abortControllerRef = useRef<AbortController | null>(null);
|
||||||
|
|
||||||
const [focused, setFocused] = useState(false);
|
const [focused, setFocused] = useState(false);
|
||||||
|
|
||||||
const [searchParams] = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
@ -43,8 +45,16 @@ export default function Catalogue() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setGames([]);
|
setGames([]);
|
||||||
|
abortControllerRef.current?.abort();
|
||||||
|
|
||||||
|
const abortController = new AbortController();
|
||||||
|
abortControllerRef.current = abortController;
|
||||||
|
|
||||||
window.electron.searchGames(filters).then((games) => {
|
window.electron.searchGames(filters).then((games) => {
|
||||||
|
if (abortController.signal.aborted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setGames(games);
|
setGames(games);
|
||||||
});
|
});
|
||||||
}, [filters]);
|
}, [filters]);
|
||||||
|
Loading…
Reference in New Issue
Block a user