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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user