{ event.preventDefault(); try { profilesPromise = getPlayerProfiles( (uuid = await getUUID(username)) ); } catch (error) { status = "Not found"; } }} >
Add profile
{status}
{#if uuid !== ""} {#await profilesPromise}
Fetching profiles...
{:then profiles} {#each profiles as profile}
{ try { await putProfiles( $login?.token, profile.profile_id, uuid ); } catch (e) { if ( e.response?.status === 401 || e.response?.status === 403 ) { alert("Unauthorised"); } else { alert( "An error occured while adding the profile" ); } } goto("/#"); }} > {#await getUsername(uuid)}
...
{:then properUsername}
{properUsername} @ {profile.cute_name}
{/await} {#each Object.keys(profile.members).filter(m => m !== uuid) as member} {#await getUsername(member)}
...
{:then memberUsername}
{memberUsername}
{:catch error}
{error.message}
{/await} {/each}
{/each} {:catch error}
{error.message}
{/await} {/if}