Renamed nullable utils into isDefined and isUndefinedOrNull (#4402)
* Renamed nullable utils into isDefined and isUndefinedOrNull
This commit is contained in:
@ -33,7 +33,7 @@ import {
|
||||
TimelineThread,
|
||||
TimelineThreadsWithTotal,
|
||||
} from '~/generated/graphql';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
display: flex;
|
||||
@ -141,7 +141,7 @@ export const EmailThreads = ({
|
||||
}
|
||||
};
|
||||
|
||||
if (isNonNullable(error)) {
|
||||
if (isDefined(error)) {
|
||||
enqueueSnackBar(error.message || 'Error loading email threads', {
|
||||
variant: 'error',
|
||||
});
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
|
||||
import { EmailThreadMessageParticipant } from '@/activities/emails/types/EmailThreadMessageParticipant';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
export const getDisplayNameFromParticipant = ({
|
||||
participant,
|
||||
@ -10,14 +10,14 @@ export const getDisplayNameFromParticipant = ({
|
||||
participant: EmailThreadMessageParticipant;
|
||||
shouldUseFullName?: boolean;
|
||||
}) => {
|
||||
if (isNonNullable(participant.person)) {
|
||||
if (isDefined(participant.person)) {
|
||||
return (
|
||||
`${participant.person?.name?.firstName}` +
|
||||
(shouldUseFullName ? ` ${participant.person?.name?.lastName}` : '')
|
||||
);
|
||||
}
|
||||
|
||||
if (isNonNullable(participant.workspaceMember)) {
|
||||
if (isDefined(participant.workspaceMember)) {
|
||||
return (
|
||||
participant.workspaceMember?.name?.firstName +
|
||||
(shouldUseFullName
|
||||
|
||||
Reference in New Issue
Block a user