From 2d89d07e219af29d70d79fb7cc32bb02d993add2 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Wed, 1 Sep 2021 13:15:15 -0400 Subject: [PATCH] Minor tweak --- app/views/DiscussionMessagesView.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/DiscussionMessagesView.js b/app/views/DiscussionMessagesView.js index 6069419a2..4e6750192 100644 --- a/app/views/DiscussionMessagesView.js +++ b/app/views/DiscussionMessagesView.js @@ -1,3 +1,4 @@ +/* eslint-disable react/prop-types */ import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; import { FlatList } from 'react-native'; @@ -29,6 +30,7 @@ const DiscussionMessagesView = ({ navigation, route }) => { const canAutoTranslate = route.params?.canAutoTranslate; const autoTranslate = route.params?.autoTranslate; const autoTranslateLanguage = route.params?.autoTranslateLanguage; + const user = useSelector(state => state.login?.user); const baseUrl = useSelector(state => state.server.server); const useRealName = useSelector(state => state.settings.UI_Use_Real_Name); const Message_TimeFormat = useSelector(state => state.settings.Message_TimeFormat); @@ -69,7 +71,8 @@ const DiscussionMessagesView = ({ navigation, route }) => { ]; if (text?.trim()) { - whereClause.push(Q.where('msg', Q.like(`%${ sanitizeLikeString(text?.trim()) }%`))); + whereClause.push(Q.where('msg', Q.like(`%${ sanitizeLikeString(text?.trim()) }%`)), + Q.where('username', Q.like(`%${ sanitizeLikeString(text?.trim()) }%`))); } const discussionsMessages = await db @@ -156,13 +159,12 @@ const DiscussionMessagesView = ({ navigation, route }) => { }); }, 1000, true); - // eslint-disable-next-line react/prop-types const renderItem = ({ item }) => ( {}} onDiscussionPress={onDiscussionPress} baseUrl={baseUrl} timeFormat={Message_TimeFormat} @@ -186,7 +188,6 @@ const DiscussionMessagesView = ({ navigation, route }) => { item.msg} style={{ backgroundColor: themes[theme].backgroundColor }} onEndReachedThreshold={0.5}