fix lookup confirmations
having that "lookp user" check *twice* meant that typing a full username, and then canceling the lookup confirmation, ended up doing a lookup anyway now, if you cancel the looup confirmation, you get a search thanks to @Ares on Discord for reporting
This commit is contained in:
parent
c19746d9d8
commit
42d6e0deeb
1 changed files with 16 additions and 23 deletions
|
@ -85,33 +85,26 @@ async function search() {
|
|||
}
|
||||
//#endregion
|
||||
|
||||
if (query.length > 1 && !query.includes(' ')) {
|
||||
if (query.startsWith('@')) {
|
||||
const confirm = await os.confirm({
|
||||
type: 'info',
|
||||
text: i18n.ts.lookupConfirm,
|
||||
});
|
||||
if (!confirm.canceled) {
|
||||
router.push(`/${query}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (query.startsWith('#')) {
|
||||
const confirm = await os.confirm({
|
||||
type: 'info',
|
||||
text: i18n.ts.openTagPageConfirm,
|
||||
});
|
||||
if (!confirm.canceled) {
|
||||
router.push(`/user-tags/${encodeURIComponent(query.substring(1))}`);
|
||||
return;
|
||||
}
|
||||
if (query.length > 1 && !query.includes(' ') && query.startsWith('#')) {
|
||||
const confirm = await os.confirm({
|
||||
type: 'info',
|
||||
text: i18n.ts.openTagPageConfirm,
|
||||
});
|
||||
if (!confirm.canceled) {
|
||||
router.push(`/user-tags/${encodeURIComponent(query.substring(1))}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (query.match(/^@[a-z0-9_.-]+@[a-z0-9_.-]+$/i)) {
|
||||
router.push(`/${query}`);
|
||||
return;
|
||||
const confirm = await os.confirm({
|
||||
type: 'info',
|
||||
text: i18n.ts.lookupConfirm,
|
||||
});
|
||||
if (!confirm.canceled) {
|
||||
router.push(`/${query}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
userPagination.value = {
|
||||
|
|
Loading…
Add table
Reference in a new issue