diff --git a/src/components/views/avatars/RoomAvatarView.tsx b/src/components/views/avatars/RoomAvatarView.tsx index f75b214063..408690fa1d 100644 --- a/src/components/views/avatars/RoomAvatarView.tsx +++ b/src/components/views/avatars/RoomAvatarView.tsx @@ -55,17 +55,10 @@ export function RoomAvatarView({ room }: RoomAvatarViewProps): JSX.Element { ); } -type PresenceDecorationProps = { - /** - * The presence of the user in the DM room. - */ - presence: NonNullable; -}; - /** - * Component to display the presence of a user in a DM room. + * Get the decoration for the avatar based on the presence. */ -function PresenceDecoration({ presence }: PresenceDecorationProps): JSX.Element { +function getPresenceDecoration(presence: Presence): JSX.Element { switch (presence) { case Presence.Online: return ( @@ -142,7 +135,7 @@ function getAvatarDecoration(decoration: AvatarBadgeDecoration, presence: Presen /> ); } else if (decoration === AvatarBadgeDecoration.Presence) { - return ; + return getPresenceDecoration(presence!); } } diff --git a/test/unit-tests/components/views/avatars/__snapshots__/RoomAvatarView-test.tsx.snap b/test/unit-tests/components/views/avatars/__snapshots__/RoomAvatarView-test.tsx.snap index 2acfaf1f00..a1b74d4654 100644 --- a/test/unit-tests/components/views/avatars/__snapshots__/RoomAvatarView-test.tsx.snap +++ b/test/unit-tests/components/views/avatars/__snapshots__/RoomAvatarView-test.tsx.snap @@ -179,6 +179,7 @@ exports[` should render the AWAY presence 1`] = ` should render the BUSY presence 1`] = ` should render the OFFLINE presence 1`] = ` should render the ONLINE presence 1`] = `