fix: usernames

This commit is contained in:
cha0s 2020-07-25 03:27:37 -05:00
parent ef772986cf
commit 913342c5f3

View File

@ -26,8 +26,12 @@ export const fetchUsernames = createAsyncThunk(
if (0 === missingIds.length) { if (0 === missingIds.length) {
return hasAnonymous ? [[0, 'anonymous']] : []; return hasAnonymous ? [[0, 'anonymous']] : [];
} }
return new Promise((resolve) => ( return new Promise((resolve, reject) => (
socket.send(new Usernames(missingIds), (usernames) => { socket.send(new Usernames(missingIds), (error, usernames) => {
if (error) {
reject(error);
return;
}
resolve( resolve(
missingIds missingIds
.map((id, i) => [id, usernames[i]]) .map((id, i) => [id, usernames[i]])