Compare commits

...

2 Commits

Author SHA1 Message Date
6cbf0a9265 Merge branch 'master' of https://git.fascinated.cc/Fascinated/scoresaber-reloaded
All checks were successful
deploy / deploy (push) Successful in 48s
2023-10-18 05:57:26 +01:00
c07f82899c fix avatars not loading if the player doesn't have a avatar 2023-10-18 05:57:23 +01:00
2 changed files with 16 additions and 6 deletions

@ -1,14 +1,22 @@
<script>
import {opt} from '../../utils/js'
import { opt } from '../../utils/js';
export let player;
$: avatar = opt(player, 'playerInfo.avatar')
const avatar = opt(player, 'playerInfo.avatar')
// TEMP WORKAROUND UNTIL I MIGRATE TO NEW SS API
export let avatarr;
if (avatar.includes("oculus")) {
avatarr = "https://cdn.scoresaber.com/avatars/oculus.png"
} else {
avatarr = `https://cdn.scoresaber.com/avatars/${player.playerId}.jpg`
}
</script>
{#if avatar}
{#if avatarr}
<figure class="image is-24x24" on:click>
<img src={avatar} alt=""/>
<img src={avatarr} alt=""/>
</figure>
{/if}

@ -1,5 +1,6 @@
<script>
import Spinner from '../Common/Spinner.svelte'
import { SS_CDN_HOST } from '../../network/queues/scoresaber/page-queue';
import Spinner from '../Common/Spinner.svelte';
export let playerInfo;
export let isLoading = false;
@ -10,7 +11,8 @@
<span class="no-image">?</span>
{#if playerInfo && playerInfo.avatar}
<img src={playerInfo.avatar} class="avatar" alt="" />
<!-- TEMP WORKAROUND UNTIL I MIGRATE TO NEW SS API -->
<img src={playerInfo.avatar.replace("https://new.scoresaber.com/api/static", SS_CDN_HOST)} class="avatar" alt="" />
{/if}
<span class="spinner">
<Spinner width="100%" height="100%"/>