feat: basic mutli-accounts support
This commit is contained in:
parent
24c573ccf0
commit
241b28241c
15 changed files with 170 additions and 34 deletions
|
@ -18,7 +18,9 @@ export const currentUser = computed<UserLogin | undefined>(() => {
|
|||
|
||||
export const currentServer = computed<string>(() => currentUser.value?.server || DEFAULT_SERVER)
|
||||
|
||||
export async function loginCallback(user: UserLogin) {
|
||||
export const useAccounts = () => accounts
|
||||
|
||||
export async function loginTo(user: UserLogin) {
|
||||
const existing = accounts.value.findIndex(u => u.server === user.server && u.token === user.token)
|
||||
if (existing !== -1) {
|
||||
if (currentId.value === accounts.value[existing].account?.id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue