1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-25 06:14:14 +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

@@ -264,10 +264,18 @@ async function search() {
const res = await apLookup(searchParams.value.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}`,
},
});
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
} else if (res.type === 'Note') {
router.push(`/notes/${res.object.id}`);
router.push('/notes/:noteId/:initialTab?', {
params: {
noteId: res.object.id,
},
});
}
return;
@@ -282,7 +290,7 @@ async function search() {
text: i18n.ts.lookupConfirm,
});
if (!confirm.canceled) {
router.push(`/${searchParams.value.query}`);
router.pushByPath(`/${searchParams.value.query}`);
return;
}
}
@@ -293,7 +301,11 @@ async function search() {
text: i18n.ts.openTagPageConfirm,
});
if (!confirm.canceled) {
router.push(`/tags/${encodeURIComponent(searchParams.value.query.substring(1))}`);
router.push('/tags/:tag', {
params: {
tag: searchParams.value.query.substring(1),
},
});
return;
}
}