@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.
@@ -5680,10 +5680,10 @@ const useChatConfig = ({
5680
5680
  userId
5681
5681
  }) => {
5682
5682
  const [displayChatIcon, setDisplayChatIcon] = useState(false);
5683
- const [unreadMessages, setUnreadMessages] = useState(false);
5683
+ const [hasUnread, setHasUnread] = useState(false);
5684
5684
  const fetchChatPerson = async () => {
5685
5685
  const url = `${window.location.origin}/~api/chat/v2/me`;
5686
- const personFields = ["can_chat_pending_age_check", "unread_messages"].join(",");
5686
+ const personFields = ["can_chat_pending_age_check", "unread_messages", "unread_reactions"].join(",");
5687
5687
  const query = `?fields[Person]=${personFields}`;
5688
5688
  const {
5689
5689
  json
@@ -5695,9 +5695,10 @@ const useChatConfig = ({
5695
5695
  }) => {
5696
5696
  const {
5697
5697
  can_chat_pending_age_check,
5698
- unread_messages
5698
+ unread_messages,
5699
+ unread_reactions
5699
5700
  } = data.attributes;
5700
- setUnreadMessages(unread_messages);
5701
+ setHasUnread(unread_messages || unread_reactions);
5701
5702
  setDisplayChatIcon(can_chat_pending_age_check);
5702
5703
  }).catch(noop);
5703
5704
  const chatJoltChannel = useJoltChannelSubscription({
@@ -5729,7 +5730,7 @@ const useChatConfig = ({
5729
5730
  }, [isEnabled]);
5730
5731
  return {
5731
5732
  displayChatIcon,
5732
- unreadIndicator: unreadMessages
5733
+ unreadIndicator: hasUnread
5733
5734
  };
5734
5735
  };
5735
5736