ui: performance update

This commit is contained in:
undefined committed 2021-10-06 16:34:50 +08:00
1 parent a03ee5ec2c
commit e15c75d4b8
2 files changed
+7 -1

No files matched your search

@@ -123,6 +123,12 @@ monaco.editor.registerCommand('hydro.openUserPage', (accesser, uid) => {
monaco.languages.registerCodeLensProvider('markdown', {
async provideCodeLenses(model) {
const users = model.findMatches('\\[\\]\\(/user/(\\d+)\\)', true, true, true, null, true);
if (!users.length) {
return {
lenses: [],
dispose: () => { },
};
}
const { data } = await api(gql`
users(ids: ${users.map((i) => +i.matches[1])}) {
_id