mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: performance update
This commit is contained in:
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,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",
|
||||||
|
|||||||
Reference in new issue
Block a user