Only show if available

This commit is contained in:
Freeplay 2023-06-11 22:12:11 -04:00
parent 19ca91c201
commit d79e974fd0
2 changed files with 6 additions and 6 deletions

View File

@ -59,15 +59,15 @@
v-if="input && input.type !== 'paragraph'"
v-model="inputValue"
autofocus
:type="input.type || 'text'"
:type="input.type == 'searchAdvanced' ? 'search' : input.type || 'text'"
:placeholder="input.placeholder || undefined"
@keydown="onInputKeydown"
:style="{ width: input.type === 'search' ? '300px' : null }"
:style="{ width: input.type === 'searchAdvanced' ? '300px' : null }"
>
<template v-if="input.type === 'password'" #prefix
><i class="ph-password ph-bold ph-lg"></i
></template>
<template v-if="input.type === 'search'" #suffix>
<template v-if="input.type === 'searchAdvanced'" #suffix>
<button
class="_buttonIcon"
@click.stop="openSearchFilters"

View File

@ -1,7 +1,7 @@
import * as os from "@/os";
import { i18n } from "@/i18n";
import { mainRouter } from "@/router";
// import { instance } from "@/instance";
import { instance } from "@/instance";
export async function search() {
// const searchOptions =
@ -15,10 +15,10 @@ export async function search() {
// "filter:following => show results only from users you follow\n" +
// "filter:followers => show results only from followers\n";
// const searchFiltersAvailable = instance.searchFilters;
const searchFiltersAvailable = instance.searchFilters;
const { canceled, result: query } = await os.inputText({
type: "search",
type: searchFiltersAvailable ? "searchAdvanced" : "search",
title: i18n.ts.search,
placeholder: i18n.ts.searchPlaceholder,
});