feat: allow setting default server via env (#854)

This commit is contained in:
Daniel Roe 2023-01-07 13:38:31 -08:00 committed by GitHub
parent 697a88ac3d
commit 57fd9aeae2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 5 deletions

View file

@ -5,7 +5,6 @@ import type { RemovableRef } from '@vueuse/core'
import type { ElkMasto, UserLogin } from '~/types'
import {
DEFAULT_POST_CHARS_LIMIT,
DEFAULT_SERVER,
STORAGE_KEY_CURRENT_USER,
STORAGE_KEY_NOTIFICATION,
STORAGE_KEY_NOTIFICATION_POLICY,
@ -57,7 +56,7 @@ export const currentUser = computed<UserLogin | undefined>(() => {
const publicInstance = ref<Instance | null>(null)
export const currentInstance = computed<null | Instance>(() => currentUser.value ? instances.value[currentUser.value.server] ?? null : publicInstance.value)
export const publicServer = ref(DEFAULT_SERVER)
export const publicServer = ref('')
export const currentServer = computed<string>(() => currentUser.value?.server || publicServer.value)
// when multiple tabs: we need to reload window when sign in, switch account or sign out