summaryrefslogtreecommitdiff
path: root/packages/frontend/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-03-29 17:22:34 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-03-29 17:22:34 +0900
commitc1d9e23171eff1eebd9e916dab5ed7a2be93e3cd (patch)
treec016731fd07af6dbeb64193b0c1e3f9173687f09 /packages/frontend/src
parentNew Crowdin updates (#10407) (diff)
downloadmisskey-c1d9e23171eff1eebd9e916dab5ed7a2be93e3cd.tar.gz
misskey-c1d9e23171eff1eebd9e916dab5ed7a2be93e3cd.tar.bz2
misskey-c1d9e23171eff1eebd9e916dab5ed7a2be93e3cd.zip
enhance(client): 検索ページでURLを入力した際に照会したときと同等の挙動をするように
Diffstat (limited to 'packages/frontend/src')
-rw-r--r--packages/frontend/src/pages/search.vue21
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/frontend/src/pages/search.vue b/packages/frontend/src/pages/search.vue
index cc6f8cc0cc..5523d5cf4d 100644
--- a/packages/frontend/src/pages/search.vue
+++ b/packages/frontend/src/pages/search.vue
@@ -56,6 +56,9 @@ import MkFoldableSection from '@/components/MkFoldableSection.vue';
import { $i } from '@/account';
import { instance } from '@/instance';
import MkInfo from '@/components/MkInfo.vue';
+import { useRouter } from '@/router';
+
+const router = useRouter();
const props = defineProps<{
query: string;
@@ -84,6 +87,24 @@ async function search() {
if (query == null || query === '') return;
+ if (query.startsWith('https://')) {
+ const promise = os.api('ap/show', {
+ uri: query,
+ });
+
+ os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject);
+
+ 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;
+ }
+
if (tab === 'note') {
notePagination = {
endpoint: 'notes/search',