refactor: inject masto instance via nuxt app (#134)

This commit is contained in:
Daniel Roe 2022-11-26 15:42:58 +00:00 committed by GitHub
parent 5c60497421
commit 39b005899e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 67 additions and 48 deletions

View file

@ -40,12 +40,12 @@ export async function loginTo(user: UserLogin & { account?: AccountCredentials }
url: `https://${user.server}`,
accessToken: user.token,
})
const me = await masto.accounts.verifyCredentials()
const me = await useMasto().accounts.verifyCredentials()
user.account = me
users.value.push(user)
currentUserId.value = me.id
servers.value[me.id] = await masto.instances.fetch()
servers.value[me.id] = await useMasto().instances.fetch()
await reloadPage()
return true
}