diff --git a/src/renderer/src/components/Librarybar/main.tsx b/src/renderer/src/components/Librarybar/main.tsx index 3509b1b3..6c40a1b6 100644 --- a/src/renderer/src/components/Librarybar/main.tsx +++ b/src/renderer/src/components/Librarybar/main.tsx @@ -1,15 +1,19 @@ +import { useEffect } from 'react' +import { useTranslation } from 'react-i18next' +import { eventBus } from '~/app/events' import { useConfigState } from '~/hooks' +import { useGameRegistry } from '~/stores/game' import { cn } from '~/utils' import { GameList } from './GameList' import { PositionButton } from './PositionButton' import { useLibrarybarStore } from './store' -import { eventBus } from '~/app/events' -import { useEffect } from 'react' export function Librarybar(): React.JSX.Element { const [selectedGroup] = useConfigState('game.gameList.selectedGroup') const query = useLibrarybarStore((state) => state.query) const refreshGameList = useLibrarybarStore((state) => state.refreshGameList) + const gamesLoaded = useGameRegistry((state) => state.gamesLoaded) + const { t } = useTranslation('game') console.warn(`[DEBUG] Librarybar`) @@ -27,6 +31,19 @@ export function Librarybar(): React.JSX.Element { } }, []) + if (!gamesLoaded) { + return ( +
+
+
{t('showcase.loadingGames')}
+
+ ) + } + return (