diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2025-02-27 11:56:17 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-27 02:56:17 +0000 |
| commit | da66079c297c18f5628d262bf5d26662e5c25011 (patch) | |
| tree | 95024635e7780791c736b571a6db150cd8e01ed2 /packages/frontend/src/scripts/gen-search-query.ts | |
| parent | fix(frontend): MkSelectの初期値が表示されない場合がある (#15559) (diff) | |
| download | sharkey-da66079c297c18f5628d262bf5d26662e5c25011.tar.gz sharkey-da66079c297c18f5628d262bf5d26662e5c25011.tar.bz2 sharkey-da66079c297c18f5628d262bf5d26662e5c25011.zip | |
enhance(frontend): ノート検索ページのデザイン調整 (#14780)
* enhance(frontend): 検索ページのホスト指定とユーザー指定を統合する (#273)
(cherry picked from commit c79392c88d6bf58ede39d8bba9ca2778c58521ef)
* fix
* :art:
* Update Changelog
* Update Changelog
* refactor
---------
Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com>
Diffstat (limited to 'packages/frontend/src/scripts/gen-search-query.ts')
| -rw-r--r-- | packages/frontend/src/scripts/gen-search-query.ts | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/packages/frontend/src/scripts/gen-search-query.ts b/packages/frontend/src/scripts/gen-search-query.ts deleted file mode 100644 index a85ee01e26..0000000000 --- a/packages/frontend/src/scripts/gen-search-query.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import * as Misskey from 'misskey-js'; -import { host as localHost } from '@@/js/config.js'; - -export async function genSearchQuery(v: any, q: string) { - let host: string; - let userId: string; - if (q.split(' ').some(x => x.startsWith('@'))) { - for (const at of q.split(' ').filter(x => x.startsWith('@')).map(x => x.substring(1))) { - if (at.includes('.')) { - if (at === localHost || at === '.') { - host = null; - } else { - host = at; - } - } else { - const user = await v.api('users/show', Misskey.acct.parse(at)).catch(x => null); - if (user) { - userId = user.id; - } else { - // todo: show error - } - } - } - } - return { - query: q.split(' ').filter(x => !x.startsWith('/') && !x.startsWith('@')).join(' '), - host: host, - userId: userId, - }; -} |