We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30444dc commit 3b530bcCopy full SHA for 3b530bc
1 file changed
src/lib/components/home/RandomGameButton.svelte
@@ -5,13 +5,8 @@
5
import { goto } from '$app/navigation';
6
7
const getRandomGame = () => {
8
- let games = Object.entries(gamesStore.list);
9
- const selectedCategories = settingsStore.selectedCategories;
10
- if(selectedCategories.length) {
11
- games = games.filter(game =>
12
- game[1].categories.some(c => selectedCategories.includes(c)
13
- ));
14
- }
+ const games = Object.entries(gamesStore.filtered);
+ console.log(games);
15
if (games.length === 0) return;
16
const randomIndex = Math.floor(Math.random() * games.length);
17
const selectedGame = games[randomIndex][0];
0 commit comments