diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-18 19:40:23 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-18 19:40:23 +0900 |
| commit | 7827aeb6951bfd0dae1799601dff3f207a3d2363 (patch) | |
| tree | fa81558061c2743bc5d6566d916f7df4a3dad34e /src/client/app/mobile/views/components | |
| parent | Fix API definition (diff) | |
| download | misskey-7827aeb6951bfd0dae1799601dff3f207a3d2363.tar.gz misskey-7827aeb6951bfd0dae1799601dff3f207a3d2363.tar.bz2 misskey-7827aeb6951bfd0dae1799601dff3f207a3d2363.zip | |
Resolve #4735
Diffstat (limited to 'src/client/app/mobile/views/components')
| -rw-r--r-- | src/client/app/mobile/views/components/ui.nav.vue | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/client/app/mobile/views/components/ui.nav.vue b/src/client/app/mobile/views/components/ui.nav.vue index 169c7fc07d..b26e2380ab 100644 --- a/src/client/app/mobile/views/components/ui.nav.vue +++ b/src/client/app/mobile/views/components/ui.nav.vue @@ -66,6 +66,7 @@ import i18n from '../../../i18n'; import { lang } from '../../../config'; import { faNewspaper, faHashtag, faHome, faColumns } from '@fortawesome/free-solid-svg-icons'; import { faMoon, faSun } from '@fortawesome/free-regular-svg-icons'; +import { search } from '../../../common/scripts/search'; export default Vue.extend({ i18n: i18n('mobile/views/components/ui.nav.vue'), @@ -133,29 +134,10 @@ export default Vue.extend({ }).then(async ({ canceled, result: query }) => { if (canceled) return; - const q = query.trim(); - if (q.startsWith('@')) { - this.$router.push(`/${q}`); - } else if (q.startsWith('#')) { - this.$router.push(`/tags/${encodeURIComponent(q.substr(1))}`); - } else if (q.startsWith('https://')) { - this.searching = true; - try { - const res = await this.$root.api('ap/show', { - uri: q - }); - if (res.type == 'User') { - this.$router.push(`/@${res.object.username}@${res.object.host}`); - } else if (res.type == 'Note') { - this.$router.push(`/notes/${res.object.id}`); - } - } catch (e) { - // TODO - } + this.searching = true; + search(this, query).finally(() => { this.searching = false; - } else { - this.$router.push(`/search?q=${encodeURIComponent(q)}`); - } + }); }); }, |