feat: account switcher sidebar (#460)
* feat: account switcher sidebar * fix: defer loading sidebar until masto initialised * fix: only show user switcher for 2 or more accounts * chore: use `ofetch` (newer version of `ohymfetch`) * chore: early alpha warning * fix: handle missing user in github preview * refactor: avoid circular auto-import Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
15b59ae9b9
commit
cd85871d01
11 changed files with 78 additions and 25 deletions
|
@ -4,6 +4,7 @@ export interface FeatureFlags {
|
|||
experimentalVirtualScroll: boolean
|
||||
experimentalAvatarOnAvatar: boolean
|
||||
experimentalGitHubCards: boolean
|
||||
experimentalUserSwitcherSidebar: boolean
|
||||
}
|
||||
export type FeatureFlagsMap = Record<string, FeatureFlags>
|
||||
|
||||
|
@ -12,6 +13,7 @@ export function getDefaultFeatureFlags(): FeatureFlags {
|
|||
experimentalVirtualScroll: false,
|
||||
experimentalAvatarOnAvatar: true,
|
||||
experimentalGitHubCards: true,
|
||||
experimentalUserSwitcherSidebar: true,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,3 +33,6 @@ export function toggleFeatureFlag(key: keyof FeatureFlags) {
|
|||
else
|
||||
featureFlags[key] = true
|
||||
}
|
||||
|
||||
const userSwitcherSidebar = eagerComputed(() => useFeatureFlags().experimentalUserSwitcherSidebar)
|
||||
export const showUserSwitcherSidebar = computed(() => useUsers().value.length > 1 && userSwitcherSidebar.value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue