-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Remove temporal fix and show notification of loading
- Loading branch information
1 parent
1d0c221
commit d464f17
Showing
2 changed files
with
38 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
<script lang="ts"> | ||
import { page } from "$app/stores"; | ||
import type { ISteamUser } from "$lib/ISteamUser"; | ||
import SteamApi from "$lib/SteamApi"; | ||
import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons"; | ||
import { onMount } from "svelte"; | ||
import { faCircleInfo, faExclamationCircle } from "@fortawesome/free-solid-svg-icons"; | ||
import { _ } from "svelte-i18n"; | ||
import Notification from "$components/Notification.svelte"; | ||
import UserStats from "$components/UserStats.svelte"; | ||
let user: ISteamUser = { addons: {} }; | ||
onMount(async () => { | ||
user = await SteamApi.getSteamUser("id", $page.params.slug); | ||
}); | ||
async function getUser() { | ||
return await SteamApi.getSteamUser("id", $page.params.slug); | ||
} | ||
</script> | ||
|
||
<section class="min-h-screen mt-28"> | ||
{#if user.message} | ||
<Notification class="bg-error" faIcon={faExclamationCircle}> | ||
{user.message} | ||
{#await getUser()} | ||
<Notification class="bg-warning" faIcon={faCircleInfo}> | ||
{$_("notifications.disclaimer")} | ||
</Notification> | ||
{:else} | ||
<UserStats steamUser={user} /> | ||
{/if} | ||
{:then data} | ||
{#if data.message} | ||
<Notification class="bg-error" faIcon={faExclamationCircle}> | ||
{data.message} | ||
</Notification> | ||
{:else} | ||
<UserStats steamUser={data} /> | ||
{/if} | ||
{:catch error} | ||
<h2>{error}</h2> | ||
{/await} | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
<script lang="ts"> | ||
import { page } from "$app/stores"; | ||
import type { ISteamUser } from "$lib/ISteamUser"; | ||
import SteamApi from "$lib/SteamApi"; | ||
import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons"; | ||
import { onMount } from "svelte"; | ||
import { faCircleInfo, faExclamationCircle } from "@fortawesome/free-solid-svg-icons"; | ||
import { _ } from "svelte-i18n"; | ||
import Notification from "$components/Notification.svelte"; | ||
import UserStats from "$components/UserStats.svelte"; | ||
let user: ISteamUser = { addons: {} }; | ||
onMount(async () => { | ||
user = await SteamApi.getSteamUser("profiles", $page.params.slug); | ||
}); | ||
async function getUser() { | ||
return await SteamApi.getSteamUser("profiles", $page.params.slug); | ||
} | ||
</script> | ||
|
||
<section class="min-h-screen mt-28"> | ||
{#if user.message} | ||
<Notification class="bg-error" faIcon={faExclamationCircle}> | ||
{user.message} | ||
{#await getUser()} | ||
<Notification class="bg-warning" faIcon={faCircleInfo}> | ||
{$_("notifications.disclaimer")} | ||
</Notification> | ||
{:else} | ||
<UserStats steamUser={user} /> | ||
{/if} | ||
{:then data} | ||
{#if data.message} | ||
<Notification class="bg-error" faIcon={faExclamationCircle}> | ||
{data.message} | ||
</Notification> | ||
{:else} | ||
<UserStats steamUser={data} /> | ||
{/if} | ||
{:catch error} | ||
<h2>{error}</h2> | ||
{/await} | ||
</section> |