1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-25 12:04:04 +02:00

enhance(frontend): typed nirax (#16309)

* enhance(frontend): typed nirax

* migrate router.replace

* fix
This commit is contained in:
かっこかり
2025-07-30 12:30:35 +09:00
committed by GitHub
parent b660769288
commit 4f653f2fbc
29 changed files with 308 additions and 52 deletions

View File

@@ -19,12 +19,16 @@ export async function lookup(router?: Router) {
if (canceled || query.length <= 1) return;
if (query.startsWith('@') && !query.includes(' ')) {
_router.push(`/${query}`);
_router.pushByPath(`/${query}`);
return;
}
if (query.startsWith('#')) {
_router.push(`/tags/${encodeURIComponent(query.substring(1))}`);
_router.push('/tags/:tag', {
params: {
tag: query.substring(1),
}
});
return;
}
@@ -32,9 +36,17 @@ export async function lookup(router?: Router) {
const res = await apLookup(query);
if (res.type === 'User') {
_router.push(`/@${res.object.username}@${res.object.host}`);
_router.push('/@:acct/:page?', {
params: {
acct: `${res.object.username}@${res.object.host}`,
},
});
} else if (res.type === 'Note') {
_router.push(`/notes/${res.object.id}`);
_router.push('/notes/:noteId/:initialTab?', {
params: {
noteId: res.object.id,
},
});
}
return;