diff options
author | mat <github@matdoes.dev> | 2022-03-19 15:44:34 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-03-19 15:44:34 -0500 |
commit | 9b6c19abe45b5b5b1ff94ad8809d6730bb1f84a4 (patch) | |
tree | 3f22ab5373f4e14c3449d3edeade585601a20e3b | |
parent | adc2cd0d0f006776ccb982a19a98934cd8855132 (diff) | |
download | skyblock-stats-9b6c19abe45b5b5b1ff94ad8809d6730bb1f84a4.tar.gz skyblock-stats-9b6c19abe45b5b5b1ff94ad8809d6730bb1f84a4.tar.bz2 skyblock-stats-9b6c19abe45b5b5b1ff94ad8809d6730bb1f84a4.zip |
Fix to actually update the active profile non-ssr
-rw-r--r-- | src/routes/player/[player]/index.svelte | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/routes/player/[player]/index.svelte b/src/routes/player/[player]/index.svelte index 95156f9..70ea2ff 100644 --- a/src/routes/player/[player]/index.svelte +++ b/src/routes/player/[player]/index.svelte @@ -40,7 +40,7 @@ let activeProfileLastSave: number = 0 let isActiveProfileOnline: boolean - $: { + function updateActiveProfile() { if (data.profiles) for (const profile of data.profiles) { if (profile.members) @@ -55,6 +55,8 @@ isActiveProfileOnline = Date.now() / 1000 - 60 < activeProfileLastSave } + $: [data, updateActiveProfile()] + $: backgroundUrl = data.customization?.backgroundUrl ?? (data.player ? chooseDefaultBackground(data.player.uuid) : null) |