forked from AkkomaGang/akkoma-fe
boot: cleanup resolveStaffAccounts
This commit is contained in:
parent
6dfe3cc911
commit
a4ae956a62
1 changed files with 2 additions and 7 deletions
|
@ -185,14 +185,9 @@ const getAppSecret = async ({ store }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const resolveStaffAccounts = async ({ store, accounts }) => {
|
const resolveStaffAccounts = async ({ store, accounts }) => {
|
||||||
let nicknames = accounts.map(uri => uri.split('/').pop())
|
|
||||||
const backendInteractor = store.state.api.backendInteractor
|
const backendInteractor = store.state.api.backendInteractor
|
||||||
|
let nicknames = accounts.map(uri => uri.split('/').pop())
|
||||||
nicknames = nicknames.map(id => {
|
.map(id => backendInteractor.fetchUser({ id }))
|
||||||
console.log('resolving staff account:', id)
|
|
||||||
return backendInteractor.fetchUser({ id })
|
|
||||||
})
|
|
||||||
|
|
||||||
nicknames = await Promise.all(nicknames)
|
nicknames = await Promise.all(nicknames)
|
||||||
|
|
||||||
store.dispatch('setInstanceOption', { name: 'staffAccounts', value: nicknames })
|
store.dispatch('setInstanceOption', { name: 'staffAccounts', value: nicknames })
|
||||||
|
|
Loading…
Reference in a new issue