mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-04 13:08:33 +01:00
fix(settings): guard empty-token copy, search platform filter and clear button
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { t } from "i18next";
|
||||
import type React from "react";
|
||||
import { TextInput, View } from "react-native";
|
||||
import { TextInput, TouchableOpacity, View } from "react-native";
|
||||
|
||||
export const SettingsSearchBar: React.FC<{
|
||||
value: string;
|
||||
@@ -17,7 +17,12 @@ export const SettingsSearchBar: React.FC<{
|
||||
className='flex-1 ml-2 text-white text-[15px]'
|
||||
autoCapitalize='none'
|
||||
autoCorrect={false}
|
||||
clearButtonMode='while-editing'
|
||||
returnKeyType='search'
|
||||
/>
|
||||
{value.length > 0 ? (
|
||||
<TouchableOpacity onPress={() => onChange("")} hitSlop={8}>
|
||||
<Ionicons name='close-circle' size={18} color='#76767c' />
|
||||
</TouchableOpacity>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -3,6 +3,7 @@ export interface SearchableOption {
|
||||
parentRoute: string;
|
||||
parentTitleKey: string;
|
||||
keywords?: string[];
|
||||
platforms?: ("ios" | "android")[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,6 +35,7 @@ export const useSettingsSearch = (query: string): SearchResult[] => {
|
||||
}
|
||||
}
|
||||
for (const o of SETTINGS_SEARCH_INDEX) {
|
||||
if (o.platforms && !o.platforms.includes(os)) continue;
|
||||
if (matchesQuery({ title: t(o.titleKey), keywords: o.keywords }, query)) {
|
||||
results.push({
|
||||
id: `${o.parentRoute}#${o.titleKey}`,
|
||||
|
||||
Reference in New Issue
Block a user