From 42d6e0deeb2814828e32dde9628efdda0bea4919 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 28 Feb 2025 17:45:45 +0000 Subject: [PATCH] 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 --- packages/frontend/src/pages/search.user.vue | 39 +++++++++------------ 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/packages/frontend/src/pages/search.user.vue b/packages/frontend/src/pages/search.user.vue index 772ee91d63..8d0899a30c 100644 --- a/packages/frontend/src/pages/search.user.vue +++ b/packages/frontend/src/pages/search.user.vue @@ -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 = {