diff --git a/vue/src/views/home/Steam.vue b/vue/src/views/home/Steam.vue index 5f70ac7..6ceb12d 100644 --- a/vue/src/views/home/Steam.vue +++ b/vue/src/views/home/Steam.vue @@ -17,91 +17,105 @@ let nextId = null; let refreshId = null; function nextGame() { - clearTimeout(nextId); - nextId = setTimeout(nextGame, 5000); - if (steamStatus.value.recentGames.length) { - idx.value = (idx.value + 1) % steamStatus.value.recentGames.length; - } + clearTimeout(nextId); + nextId = setTimeout(nextGame, 5000); + if (steamStatus.value.recentGames.length) { + idx.value = (idx.value + 1) % steamStatus.value.recentGames.length; + } } onMounted(() => { - nextId = setTimeout(nextGame, 5000); - refreshId = setInterval(() => steamStore.fetchSteam(), 5 * 60 * 1000); + nextId = setTimeout(nextGame, 5000); + refreshId = setInterval(() => steamStore.fetchSteam(), 5 * 60 * 1000); }); onUnmounted(() => { - clearTimeout(nextId); - clearInterval(refreshId); + clearTimeout(nextId); + clearInterval(refreshId); }); function formatHours(minutes) { - const hrs = (minutes / 60).toFixed(1); - return `${hrs}h`; + const hrs = (minutes / 60).toFixed(1); + return `${hrs}h`; } - - - - Steam - - - + + + + Steam + + + - Loading... + Loading... - - - - - {{ game.name }} - - - {{ formatHours(game.playtime2Weeks) }} last 2 weeks - - - + + + + + + {{ game.name }} + + + {{ formatHours(game.playtime2Weeks) }} last 2 weeks + + + + - No recent games. - + No recent games. +
- {{ game.name }} -
- {{ formatHours(game.playtime2Weeks) }} last 2 weeks -
+ {{ game.name }} +
+ {{ formatHours(game.playtime2Weeks) }} last 2 weeks +