mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 11:42:10 +00:00
feat: disable next random suggestion button until game details finish loading
This commit is contained in:
parent
a8b236e02c
commit
5f3dc5d0ea
1 changed files with 4 additions and 0 deletions
|
@ -33,6 +33,7 @@ export function GameDetails() {
|
||||||
const { objectID, shop } = useParams();
|
const { objectID, shop } = useParams();
|
||||||
|
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [isLoadingRandomGame, setIsLoadingRandomGame] = useState(false);
|
||||||
const [color, setColor] = useState("");
|
const [color, setColor] = useState("");
|
||||||
const [gameDetails, setGameDetails] = useState<ShopDetails | null>(null);
|
const [gameDetails, setGameDetails] = useState<ShopDetails | null>(null);
|
||||||
const [howLongToBeat, setHowLongToBeat] = useState<{
|
const [howLongToBeat, setHowLongToBeat] = useState<{
|
||||||
|
@ -97,6 +98,7 @@ export function GameDetails() {
|
||||||
|
|
||||||
setGameDetails(result);
|
setGameDetails(result);
|
||||||
dispatch(setHeaderTitle(result.name));
|
dispatch(setHeaderTitle(result.name));
|
||||||
|
setIsLoadingRandomGame(false);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
@ -149,6 +151,7 @@ export function GameDetails() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRandomizerClick = async () => {
|
const handleRandomizerClick = async () => {
|
||||||
|
setIsLoadingRandomGame(true);
|
||||||
const randomGameObjectID = await window.electron.getRandomGame();
|
const randomGameObjectID = await window.electron.getRandomGame();
|
||||||
|
|
||||||
const searchParams = new URLSearchParams({
|
const searchParams = new URLSearchParams({
|
||||||
|
@ -269,6 +272,7 @@ export function GameDetails() {
|
||||||
className={styles.randomizerButton}
|
className={styles.randomizerButton}
|
||||||
onClick={handleRandomizerClick}
|
onClick={handleRandomizerClick}
|
||||||
theme="outline"
|
theme="outline"
|
||||||
|
disabled={isLoadingRandomGame}
|
||||||
>
|
>
|
||||||
<div style={{ width: 16, height: 16, position: "relative" }}>
|
<div style={{ width: 16, height: 16, position: "relative" }}>
|
||||||
<Lottie
|
<Lottie
|
||||||
|
|
Loading…
Reference in a new issue