From 913342c5f352545c630ca242fbc6a1090af0ca22 Mon Sep 17 00:00:00 2001 From: cha0s Date: Sat, 25 Jul 2020 03:27:37 -0500 Subject: [PATCH] fix: usernames --- src/common/state/usernames.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/state/usernames.js b/src/common/state/usernames.js index 8adcbf3..af2d4e3 100644 --- a/src/common/state/usernames.js +++ b/src/common/state/usernames.js @@ -26,8 +26,12 @@ export const fetchUsernames = createAsyncThunk( if (0 === missingIds.length) { return hasAnonymous ? [[0, 'anonymous']] : []; } - return new Promise((resolve) => ( - socket.send(new Usernames(missingIds), (usernames) => { + return new Promise((resolve, reject) => ( + socket.send(new Usernames(missingIds), (error, usernames) => { + if (error) { + reject(error); + return; + } resolve( missingIds .map((id, i) => [id, usernames[i]])