diff options
| author | Adam Soltys <[email protected]> | 2022-07-30 09:47:08 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-07-30 09:47:08 -0700 |
| commit | 8acc59a86b6ec049dfe07f92fd19eeda726136f3 (patch) | |
| tree | 56c6506d19c38a59fba962c53a71526b3a1825b5 /src/components | |
| parent | 1f8b1f52431dc7a95118b310dbca3a178d24614b (diff) | |
| download | coinos-ui-8acc59a86b6ec049dfe07f92fd19eeda726136f3.tar.gz coinos-ui-8acc59a86b6ec049dfe07f92fd19eeda726136f3.zip | |
logout function
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/AppHeader.svelte | 4 | ||||
| -rw-r--r-- | src/components/RegisterOrLogin.svelte | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 6376e27f..b096f01e 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -14,9 +14,11 @@ <button class="bg-white p-2 rounded-full w-12 h-12" ><Icon icon="clock" style="mx-auto" /></button > - <button class="bg-white p-2 rounded-full w-12 h-12" + <a href={`/${$user.username}`}> + <button class="bg-white p-2 rounded-full w-12 h-12" ><Icon icon="profile" style="mx-auto" /></button > + </a> <button class="bg-white p-2 rounded-full w-12 h-12" ><Icon icon="menu" style="mx-auto" /></button > diff --git a/src/components/RegisterOrLogin.svelte b/src/components/RegisterOrLogin.svelte index b42b8d7f..f5764a85 100644 --- a/src/components/RegisterOrLogin.svelte +++ b/src/components/RegisterOrLogin.svelte @@ -1,7 +1,7 @@ <script> import { Icon } from '$comp'; import { post } from '$lib/utils'; - import { token } from '$lib/store'; + import { user, token } from '$lib/store'; import { auth } from '$lib/socket'; import { goto } from '$app/navigation'; @@ -22,7 +22,7 @@ if (!r.token) r = await post('/login', { username, password }); $token = r.token; auth(); - goto('/receive'); + user.subscribe(() => goto('/receive')); }; </script> |
