mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
PadMessageHandler: Use await
instead of p.then()
This commit is contained in:
parent
3262ff1cb9
commit
8756fed80d
1 changed files with 33 additions and 35 deletions
|
@ -1193,9 +1193,8 @@ async function handleClientReady(client, message)
|
||||||
let cached = historicalAuthorData[author];
|
let cached = historicalAuthorData[author];
|
||||||
|
|
||||||
// reuse previously created cache of author's data
|
// 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
|
// default fallback color to use if authorInfo.colorId is null
|
||||||
const defaultColor = "#daf0b2";
|
const defaultColor = "#daf0b2";
|
||||||
|
|
||||||
|
@ -1234,7 +1233,6 @@ async function handleClientReady(client, message)
|
||||||
};
|
};
|
||||||
|
|
||||||
client.json.send(msg);
|
client.json.send(msg);
|
||||||
});
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue