isInSystemContacts should use systemName

This commit is contained in:
Fedor Indutny 2023-03-22 12:25:52 -07:00 committed by GitHub
parent f272433b7a
commit 56145fabcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 2 deletions

View file

@ -4,9 +4,16 @@
export const isInSystemContacts = ({
type,
name,
systemGivenName,
systemFamilyName,
}: Readonly<{
type?: string;
name?: string;
systemGivenName?: string;
systemFamilyName?: string;
}>): boolean =>
// `direct` for redux, `private` for models and the database
(type === 'direct' || type === 'private') && typeof name === 'string';
(type === 'direct' || type === 'private') &&
(typeof name === 'string' ||
typeof systemGivenName === 'string' ||
typeof systemFamilyName === 'string');