diff --git a/AquaNet/src/App.svelte b/AquaNet/src/App.svelte index 127d820e..948ebb61 100644 --- a/AquaNet/src/App.svelte +++ b/AquaNet/src/App.svelte @@ -34,12 +34,19 @@ let me: AquaNetUser let playedMai = false + let recentGame: string = "mai2"; + if (USER.isLoggedIn()) { USER.me().then(m => { me = m CARD.userGames(me.username).then(game => { playedMai = !!game.mai2 + recentGame = Object.keys(game) + .filter(k => !!game[k]) + .sort((a, b) => { + return (new Date(game[b].lastLogin)) - (new Date(game[a].lastLogin)) + })[0] ?? "mai2" }) }).catch(e => console.error(e)) } @@ -61,7 +68,8 @@ {t('navigation.home').toLowerCase()} - {t('navigation.rankings').toLowerCase()} + + {t('navigation.rankings').toLowerCase()} {#if playedMai} photo {/if}