fixing some redundant changes

This commit is contained in:
samay-kothari 2022-04-16 13:07:57 +05:30
parent fb3c6d8069
commit ce0ef4097a
1 changed files with 4 additions and 4 deletions

View File

@ -140,10 +140,10 @@ class SearchMessagesView extends React.Component<ISearchMessagesViewProps, ISear
return []; return [];
} }
// If it's a encrypted, room we'll search only on the local stored messages // If it's a encrypted, room we'll search only on the local stored messages
const db = database.active;
const likeString = sanitizeLikeString(searchText);
if (this.encrypted) { if (this.encrypted) {
const db = database.active;
const messagesCollection = db.get('messages'); const messagesCollection = db.get('messages');
const likeString = sanitizeLikeString(searchText);
return messagesCollection return messagesCollection
.query( .query(
// Messages of this room // Messages of this room
@ -158,9 +158,9 @@ class SearchMessagesView extends React.Component<ISearchMessagesViewProps, ISear
if (result.success) { if (result.success) {
const urlRenderMessages = result.messages?.map(message => { const urlRenderMessages = result.messages?.map(message => {
// @ts-ignore // @ts-ignore
if (message.urls.length > 0) { if (message.urls && message.urls.length > 0) {
message.urls = message.urls?.map((url, index) => { message.urls = message.urls?.map((url, index) => {
if (url.meta !== undefined) { if (url.meta) {
return { return {
_id: index, _id: index,
title: url.meta.pageTitle, title: url.meta.pageTitle,