From f84eecea964b90e9b115eac19ed6f19a603a6bbc Mon Sep 17 00:00:00 2001 From: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> Date: Sat, 25 May 2024 11:11:12 +0900 Subject: [PATCH] =?UTF-8?q?enhance(frontend):=20=E6=A4=9C=E7=B4=A2?= =?UTF-8?q?=E7=AF=84=E5=9B=B2=E7=AD=89=E3=81=8C=E6=8C=87=E5=AE=9A=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E6=99=82=E3=81=AF=E7=85=A7?= =?UTF-8?q?=E4=BC=9A/=E3=83=8F=E3=83=83=E3=82=B7=E3=83=A5=E3=82=BF?= =?UTF-8?q?=E3=82=B0=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E9=96=8B=E3=81=8B?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/pages/search.note.vue | 34 ++++++++++---------- packages/frontend/src/pages/search.user.vue | 35 +++++++++++---------- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/packages/frontend/src/pages/search.note.vue b/packages/frontend/src/pages/search.note.vue index 3945baa00a..1964de7159 100644 --- a/packages/frontend/src/pages/search.note.vue +++ b/packages/frontend/src/pages/search.note.vue @@ -74,27 +74,29 @@ async function search() { if (query == null || query === '') return; - if (query.startsWith('https://')) { - const promise = misskeyApi('ap/show', { - uri: query, - }); + if (!user.value && !isLocalOnly.value) { + if (query.startsWith('https://')) { + const promise = misskeyApi('ap/show', { + uri: query, + }); - os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject); + os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject); - const res = await promise; + const res = await promise; - if (res.type === 'User') { - router.push(`/@${res.object.username}@${res.object.host}`); - } else if (res.type === 'Note') { - router.push(`/notes/${res.object.id}`); + if (res.type === 'User') { + router.push(`/@${res.object.username}@${res.object.host}`); + } else if (res.type === 'Note') { + router.push(`/notes/${res.object.id}`); + } + + return; } - return; - } - - if (query.startsWith('#') && query.length > 1) { - router.push(`/tags/${encodeURIComponent(query.substring(1))}`); - return; + if (query.startsWith('#') && query.length > 1) { + router.push(`/tags/${encodeURIComponent(query.substring(1))}`); + return; + } } notePagination.value = { diff --git a/packages/frontend/src/pages/search.user.vue b/packages/frontend/src/pages/search.user.vue index b8a41bfd95..bd5613418b 100644 --- a/packages/frontend/src/pages/search.user.vue +++ b/packages/frontend/src/pages/search.user.vue @@ -48,27 +48,30 @@ async function search() { if (query == null || query === '') return; - if (query.startsWith('https://')) { - const promise = misskeyApi('ap/show', { - uri: query, - }); + if (searchOrigin.value === 'combined') { - os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject); + if (query.startsWith('https://')) { + const promise = misskeyApi('ap/show', { + uri: query, + }); - const res = await promise; + os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject); - if (res.type === 'User') { - router.push(`/@${res.object.username}@${res.object.host}`); - } else if (res.type === 'Note') { - router.push(`/notes/${res.object.id}`); + const res = await promise; + + if (res.type === 'User') { + router.push(`/@${res.object.username}@${res.object.host}`); + } else if (res.type === 'Note') { + router.push(`/notes/${res.object.id}`); + } + + return; } - return; - } - - if (query.startsWith('#') && query.length > 1) { - router.push(`/user-tags/${encodeURIComponent(query.substring(1))}`); - return; + if (query.startsWith('#') && query.length > 1) { + router.push(`/user-tags/${encodeURIComponent(query.substring(1))}`); + return; + } } userPagination.value = {