Skip to content
Snippets Groups Projects
Commit c1d9e231 authored by syuilo's avatar syuilo
Browse files

enhance(client): 検索ページでURLを入力した際に照会したときと同等の挙動をするように

parent a529b0e5
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,17 @@
-->
## 13.x.x (unreleased)
### General
-
### Client
- 検索ページでURLを入力した際に照会したときと同等の挙動をするように
### Server
-
## 13.10.3
### Changes
......
......@@ -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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment