mobile: fix tag suggestions in share widget (#2354)

This commit is contained in:
Ammar Ahmed
2023-04-15 16:31:59 +05:00
committed by GitHub
parent 1da5fd3661
commit 2197f1ec5e

View File

@@ -17,23 +17,22 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { FlashList } from "@shopify/flash-list";
import React, { useEffect, useRef, useState } from "react";
import {
ActivityIndicator,
Platform,
StatusBar,
Text,
TextInput,
TouchableOpacity,
useWindowDimensions,
View
View,
useWindowDimensions
} from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import { db } from "../app/common/database";
import { getElevation } from "../app/utils";
import { useShareStore } from "./store";
import { FlashList } from "@shopify/flash-list";
const ListItem = ({ item, mode, close }) => {
const colors = useShareStore((state) => state.colors);
@@ -338,7 +337,13 @@ export const Search = ({ close, getKeyboardHeight, quicknote, mode }) => {
renderItem={renderItem}
estimatedItemSize={50}
ListHeaderComponent={
searchResults.length === 0 && searchKeyword.current ? (
mode === "selectTags" &&
(searchResults.length === 0 ||
(searchKeyword.current &&
searchKeyword.current.length > 0 &&
!searchResults.find(
(item) => item.title === searchKeyword.current
))) ? (
<ListItem
item={{
type: "tag",