diff --git a/src/lib/auth.ts b/src/lib/auth.ts index 0ec0fc67..f63b5270 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -42,10 +42,13 @@ export const profileData = writable( getFromStorage('profileData') ?? { profiles: [], profile: -1 } ) -profileData.subscribe((pd) => { +let initialInstance = get(profileData).defaultInstance + +profileData.subscribe(async (pd) => { setFromStorage('profileData', pd) - if (pd.profile == -1) { + if (pd.profile == -1 && pd.defaultInstance != initialInstance) { + initialInstance = get(profileData).defaultInstance ?? DEFAULT_INSTANCE_URL instance.set(get(profileData).defaultInstance ?? DEFAULT_INSTANCE_URL) } }) diff --git a/src/lib/components/ui/Sidebar.svelte b/src/lib/components/ui/Sidebar.svelte index 82f76b0c..ecd28a52 100644 --- a/src/lib/components/ui/Sidebar.svelte +++ b/src/lib/components/ui/Sidebar.svelte @@ -80,7 +80,12 @@ class="text-blue-500" style="filter: hue-rotate({index * 50}deg)" /> - {prof.username} + + {prof.username} + + @{prof.instance} + + {/each} {/if}