From 4bd5ab8969fa586e435ffd62dbca5712e6aed70c Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Wed, 2 Nov 2022 00:17:30 +0000 Subject: [PATCH] Move all profile stuff into the profile component and auto redirect / to /login --- src/components/profile/Profile.svelte | 2 +- src/routes/index/IndexRoute.svelte | 12 ++++---- src/routes/profile/ProfileRoute.svelte | 38 ++++---------------------- 3 files changed, 13 insertions(+), 39 deletions(-) diff --git a/src/components/profile/Profile.svelte b/src/components/profile/Profile.svelte index 51fa1ba..f9e9fbb 100644 --- a/src/components/profile/Profile.svelte +++ b/src/components/profile/Profile.svelte @@ -13,7 +13,7 @@ onMount(async () => { try { - user = await getUser("@me"); + user = await getUser(id); } catch (_) {} }); diff --git a/src/routes/index/IndexRoute.svelte b/src/routes/index/IndexRoute.svelte index a11be68..595d906 100644 --- a/src/routes/index/IndexRoute.svelte +++ b/src/routes/index/IndexRoute.svelte @@ -1,8 +1,8 @@ + import {onMount} from "svelte"; + import {navigate} from "svelte-navigator"; - - - + onMount(() => { + navigate("/login"); + }); + diff --git a/src/routes/profile/ProfileRoute.svelte b/src/routes/profile/ProfileRoute.svelte index 121d14d..f66013f 100644 --- a/src/routes/profile/ProfileRoute.svelte +++ b/src/routes/profile/ProfileRoute.svelte @@ -1,7 +1,9 @@ -
-
- {#if profile.icon} -
- User Icon -
- {/if} - {#if profile.display_name} -
{profile.display_name}
- {/if} - {#if profile.username} -
{profile.username}
- {/if} -
- Edit Profile -
-
01:18 (UTC +01:00)
- - - -
-
-
-
-
+ + +