feat: add instance to sidebar

This commit is contained in:
Xyphyn committed 2023-08-01 13:59:33 -07:00
1 parent 7f38c4bddf
commit e01fcee89e
2 files changed
+11 -3

No files matched your search

+5 -2
View File
@@ -42,10 +42,13 @@ export const profileData = writable<ProfileData>(
getFromStorage<ProfileData>('profileData') ?? { profiles: [], profile: -1 } getFromStorage<ProfileData>('profileData') ?? { profiles: [], profile: -1 }
) )
profileData.subscribe((pd) => { let initialInstance = get(profileData).defaultInstance
profileData.subscribe(async (pd) => {
setFromStorage('profileData', 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) instance.set(get(profileData).defaultInstance ?? DEFAULT_INSTANCE_URL)
} }
}) })
+6 -1
View File
@@ -80,7 +80,12 @@
class="text-blue-500" class="text-blue-500"
style="filter: hue-rotate({index * 50}deg)" style="filter: hue-rotate({index * 50}deg)"
/> />
<span class:hidden={!expanded}>{prof.username}</span> <span class:hidden={!expanded} class="flex gap-0">
{prof.username}
<span class="text-slate-500 dark:text-zinc-500">
@{prof.instance}
</span>
</span>
</Button> </Button>
{/each} {/each}
{/if} {/if}