fix: wait for promise

This commit is contained in:
cha0s 2020-07-25 19:25:17 -05:00
parent da7542601f
commit 45845c7bac

View File

@ -35,7 +35,7 @@ export default {
const {req} = socket; const {req} = socket;
const {User} = allModels(); const {User} = allModels();
await userJoin(channel, socket.socket); await userJoin(channel, socket.socket);
const state = channelState(req, channel); const state = await channelState(req, channel);
const entries = await Promise.all( const entries = await Promise.all(
state.users.map(async (id) => [id, (await User.findByPk(id)).redditUsername]), state.users.map(async (id) => [id, (await User.findByPk(id)).redditUsername]),
); );