Fix search.ts

This commit is contained in:
syuilo
2021-01-03 23:58:24 +09:00
parent 2dcb3af70f
commit e3e5a4272b
3 changed files with 12 additions and 29 deletions

View File

@ -3,19 +3,14 @@ import * as os from '@/os';
import { i18n } from '@/i18n';
import { router } from '@/router';
export async function search(q?: string | null | undefined) {
if (q == null) {
const { canceled, result: query } = await os.dialog({
title: i18n.locale.search,
input: true
});
export async function search() {
const { canceled, result: query } = await os.dialog({
title: i18n.locale.search,
input: true
});
if (canceled || query == null || query === '') return;
if (canceled || query == null || query === '') return;
q = query;
}
q = q.trim();
const q = query.trim();
if (q.startsWith('@') && !q.includes(' ')) {
router.push(`/${q}`);
@ -39,7 +34,8 @@ export async function search(q?: string | null | undefined) {
date.setHours(23, 59, 59, 999);
}
v.$root.$emit('warp', date);
// TODO
//v.$root.$emit('warp', date);
os.dialog({
icon: faHistory,
iconOnly: true, autoClose: true