@planningcenter/topbar 12.2.3 → 12.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5690,10 +5690,10 @@ true;
5690
5690
  userId
5691
5691
  }) => {
5692
5692
  const [displayChatIcon, setDisplayChatIcon] = React.useState(false);
5693
- const [unreadMessages, setUnreadMessages] = React.useState(false);
5693
+ const [hasUnread, setHasUnread] = React.useState(false);
5694
5694
  const fetchChatPerson = async () => {
5695
5695
  const url = `${window.location.origin}/~api/chat/v2/me`;
5696
- const personFields = ["can_chat_pending_age_check", "unread_messages"].join(",");
5696
+ const personFields = ["can_chat_pending_age_check", "unread_messages", "unread_reactions"].join(",");
5697
5697
  const query = `?fields[Person]=${personFields}`;
5698
5698
  const {
5699
5699
  json
@@ -5705,9 +5705,10 @@ true;
5705
5705
  }) => {
5706
5706
  const {
5707
5707
  can_chat_pending_age_check,
5708
- unread_messages
5708
+ unread_messages,
5709
+ unread_reactions
5709
5710
  } = data.attributes;
5710
- setUnreadMessages(unread_messages);
5711
+ setHasUnread(unread_messages || unread_reactions);
5711
5712
  setDisplayChatIcon(can_chat_pending_age_check);
5712
5713
  }).catch(noop);
5713
5714
  const chatJoltChannel = useJoltChannelSubscription({
@@ -5739,7 +5740,7 @@ true;
5739
5740
  }, [isEnabled]);
5740
5741
  return {
5741
5742
  displayChatIcon,
5742
- unreadIndicator: unreadMessages
5743
+ unreadIndicator: hasUnread
5743
5744
  };
5744
5745
  };
5745
5746