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', { monaco.languages.registerCodeLensProvider('markdown', {
async provideCodeLenses(model) { async provideCodeLenses(model) {
const users = model.findMatches('\\[\\]\\(/user/(\\d+)\\)', true, true, true, null, true); const users = model.findMatches('\\[\\]\\(/user/(\\d+)\\)', true, true, true, null, true);
if (!users.length) {
return {
lenses: [],
dispose: () => { },
};
}
const { data } = await api(gql` const { data } = await api(gql`
users(ids: ${users.map((i) => +i.matches[1])}) { users(ids: ${users.map((i) => +i.matches[1])}) {
_id _id
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.22.12", "version": "4.22.13",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",