2021-02-23 14:34:28 -06:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2025-09-19 13:05:51 -07:00
|
|
|
import lodash from 'lodash';
|
|
|
|
|
|
|
|
const { isNumber } = lodash;
|
2021-02-23 14:34:28 -06:00
|
|
|
|
|
|
|
export const isConversationUnread = ({
|
|
|
|
markedUnread,
|
|
|
|
unreadCount,
|
|
|
|
}: Readonly<{
|
|
|
|
unreadCount?: number;
|
|
|
|
markedUnread?: boolean;
|
|
|
|
}>): boolean =>
|
|
|
|
Boolean(markedUnread || (isNumber(unreadCount) && unreadCount > 0));
|