update search

This commit is contained in:
DevOFVictory
2025-10-23 19:07:24 +02:00
parent 30dab9051a
commit aac4408424

View File

@@ -43,6 +43,17 @@ export default function ExploreScreen() {
Keyboard.dismiss();
}
function tagRemoved(tag: AutoCompleteItem) {
const nextTags = tags.filter((t) => t.text !== tag.text);
setTags(nextTags);
const inputs = nextTags.map((t) => t.text);
getSearchResults(inputs, 50)
.then((items) => {
setResults(items || []);
})
.catch(console.error);
}
// Keep our local show cache in sync with SHOW items returned by search
React.useEffect(() => {
const fromResults: Record<number, Show> = {};
@@ -161,7 +172,10 @@ export default function ExploreScreen() {
key={tag.text}
icon={getIconName(tag.type)}
label={tag.text}
onPress={() => setTags((prev) => prev.filter((t) => t.text !== tag.text))}
onPress={() => {
tagRemoved(tag);
}}
/>
))}
</View>