mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: adding user tags
This commit is contained in:
parent
e78de55fe7
commit
a557bbb948
1 changed files with 10 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue