Skip to content

Commit f84eece

Browse files
enhance(frontend): 検索範囲等が指定されている時は照会/ハッシュタグページを開かないように
1 parent a1513dd commit f84eece

File tree

2 files changed

+37
-32
lines changed

2 files changed

+37
-32
lines changed

packages/frontend/src/pages/search.note.vue

+18-16
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,29 @@ async function search() {
7474

7575
if (query == null || query === '') return;
7676

77-
if (query.startsWith('https://')) {
78-
const promise = misskeyApi('ap/show', {
79-
uri: query,
80-
});
77+
if (!user.value && !isLocalOnly.value) {
78+
if (query.startsWith('https://')) {
79+
const promise = misskeyApi('ap/show', {
80+
uri: query,
81+
});
8182

82-
os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject);
83+
os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject);
8384

84-
const res = await promise;
85+
const res = await promise;
8586

86-
if (res.type === 'User') {
87-
router.push(`/@${res.object.username}@${res.object.host}`);
88-
} else if (res.type === 'Note') {
89-
router.push(`/notes/${res.object.id}`);
90-
}
87+
if (res.type === 'User') {
88+
router.push(`/@${res.object.username}@${res.object.host}`);
89+
} else if (res.type === 'Note') {
90+
router.push(`/notes/${res.object.id}`);
91+
}
9192

92-
return;
93-
}
93+
return;
94+
}
9495

95-
if (query.startsWith('#') && query.length > 1) {
96-
router.push(`/tags/${encodeURIComponent(query.substring(1))}`);
97-
return;
96+
if (query.startsWith('#') && query.length > 1) {
97+
router.push(`/tags/${encodeURIComponent(query.substring(1))}`);
98+
return;
99+
}
98100
}
99101

100102
notePagination.value = {

packages/frontend/src/pages/search.user.vue

+19-16
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,30 @@ async function search() {
4848

4949
if (query == null || query === '') return;
5050

51-
if (query.startsWith('https://')) {
52-
const promise = misskeyApi('ap/show', {
53-
uri: query,
54-
});
51+
if (searchOrigin.value === 'combined') {
5552

56-
os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject);
53+
if (query.startsWith('https://')) {
54+
const promise = misskeyApi('ap/show', {
55+
uri: query,
56+
});
5757

58-
const res = await promise;
58+
os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject);
5959

60-
if (res.type === 'User') {
61-
router.push(`/@${res.object.username}@${res.object.host}`);
62-
} else if (res.type === 'Note') {
63-
router.push(`/notes/${res.object.id}`);
64-
}
60+
const res = await promise;
6561

66-
return;
67-
}
62+
if (res.type === 'User') {
63+
router.push(`/@${res.object.username}@${res.object.host}`);
64+
} else if (res.type === 'Note') {
65+
router.push(`/notes/${res.object.id}`);
66+
}
6867

69-
if (query.startsWith('#') && query.length > 1) {
70-
router.push(`/user-tags/${encodeURIComponent(query.substring(1))}`);
71-
return;
68+
return;
69+
}
70+
71+
if (query.startsWith('#') && query.length > 1) {
72+
router.push(`/user-tags/${encodeURIComponent(query.substring(1))}`);
73+
return;
74+
}
7275
}
7376

7477
userPagination.value = {

0 commit comments

Comments
 (0)