diff options
| author | taehoon <th.dev91@gmail.com> | 2019-12-15 14:29:45 -0500 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-12-15 14:30:09 -0500 |
| commit | 54f692622ad4fe6c427ae6d67816be93a7644ac8 (patch) | |
| tree | 13c7bd73c5a8bc1424aa8fa7a0eefd2203eaa341 /src/boot | |
| parent | b739edb5090a81f477cb78081f40504a3e341abd (diff) | |
wire up staff accounts with correct store data
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/after_store.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 228a0497..0bb1b2b4 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -185,12 +185,9 @@ const getAppSecret = async ({ store }) => { }) } -const resolveStaffAccounts = async ({ store, accounts }) => { - const backendInteractor = store.state.api.backendInteractor - let nicknames = accounts.map(uri => uri.split('/').pop()) - .map(id => backendInteractor.fetchUser({ id })) - nicknames = await Promise.all(nicknames) - +const resolveStaffAccounts = ({ store, accounts }) => { + const nicknames = accounts.map(uri => uri.split('/').pop()) + nicknames.map(nickname => store.dispatch('fetchUser', nickname)) store.dispatch('setInstanceOption', { name: 'staffAccounts', value: nicknames }) } @@ -236,7 +233,7 @@ const getNodeInfo = async ({ store }) => { }) const accounts = metadata.staffAccounts - await resolveStaffAccounts({ store, accounts }) + resolveStaffAccounts({ store, accounts }) } else { throw (res) } |
