mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-27 21:14:41 +02:00
enhance(frontend): typed nirax (#16309)
* enhance(frontend): typed nirax * migrate router.replace * fix
This commit is contained in:
@@ -77,10 +77,18 @@ async function search() {
|
||||
const res = await promise;
|
||||
|
||||
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;
|
||||
@@ -95,7 +103,7 @@ async function search() {
|
||||
text: i18n.ts.lookupConfirm,
|
||||
});
|
||||
if (!confirm.canceled) {
|
||||
router.push(`/${query}`);
|
||||
router.pushByPath(`/${query}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -106,7 +114,11 @@ async function search() {
|
||||
text: i18n.ts.openTagPageConfirm,
|
||||
});
|
||||
if (!confirm.canceled) {
|
||||
router.push(`/user-tags/${encodeURIComponent(query.substring(1))}`);
|
||||
router.push('/user-tags/:tag', {
|
||||
params: {
|
||||
tag: query.substring(1),
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user