PadMessageHandler: Use await instead of p.then()

This commit is contained in:
Richard Hansen 2020-09-10 18:12:20 -04:00 committed by John McLear
parent 3262ff1cb9
commit 8756fed80d

View file

@ -1193,9 +1193,8 @@ async function handleClientReady(client, message)
let cached = historicalAuthorData[author];
// reuse previously created cache of author's data
let p = cached ? Promise.resolve(cached) : authorManager.getAuthor(author);
const authorInfo = await (cached ? Promise.resolve(cached) : authorManager.getAuthor(author));
return p.then(authorInfo => {
// default fallback color to use if authorInfo.colorId is null
const defaultColor = "#daf0b2";
@ -1234,7 +1233,6 @@ async function handleClientReady(client, message)
};
client.json.send(msg);
});
}));
}
}