Merge pull request #2036 from Bilb/fix-search-result-inactive-convo

Fix search result inactive convo
This commit is contained in:
Audric Ackermann 2021-11-17 16:03:22 +11:00 committed by GitHub
commit fcff08b1c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -3,6 +3,7 @@ import { FileServerV2Request } from '../../fileserver/FileServerApiV2';
import { PubKey } from '../../session/types';
import { allowOnlyOneAtATime } from '../../session/utils/Promise';
import { updateDefaultRooms, updateDefaultRoomsInProgress } from '../../state/ducks/defaultRooms';
import { BlockedNumberController } from '../../util';
import { getCompleteUrlFromRoom } from '../utils/OpenGroupUtils';
import { parseOpenGroupV2 } from './JoinOpenGroupV2';
import { getAllRoomInfos } from './OpenGroupAPIV2';
@ -100,7 +101,11 @@ export const parseMessages = async (
}
}
return _.compact(parsedMessages).sort((a, b) => (a.serverId || 0) - (b.serverId || 0));
return _.compact(
parsedMessages.map(m =>
m && m.sender && !BlockedNumberController.isBlocked(m.sender) ? m : null
)
).sort((a, b) => (a.serverId || 0) - (b.serverId || 0));
};
// tslint:disable: no-http-string
const defaultServerUrl = 'http://116.203.70.33';

View File

@ -44,8 +44,9 @@ export const getSearchResults = createSelector(
state.conversations.map(id => {
const value = lookup[id];
// Don't return anything when activeAt is undefined (i.e. no current conversations with this user)
if (value.activeAt === undefined) {
// Don't return anything when activeAt is unset (i.e. no current conversations with this user)
if (value.activeAt === undefined || value.activeAt === 0) {
//activeAt can be 0 when linking device
return null;
}