@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.
- package/dist/topbar.js +6 -5
- package/dist/topbar.js.map +1 -1
- package/dist/topbar.modern.js +6 -5
- package/dist/topbar.modern.js.map +1 -1
- package/dist/topbar.module.js +6 -5
- package/dist/topbar.module.js.map +1 -1
- package/dist/topbar.umd.js +6 -5
- package/dist/topbar.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/topbar.module.js
CHANGED
|
@@ -5680,10 +5680,10 @@ const useChatConfig = ({
|
|
|
5680
5680
|
userId
|
|
5681
5681
|
}) => {
|
|
5682
5682
|
const [displayChatIcon, setDisplayChatIcon] = useState(false);
|
|
5683
|
-
const [
|
|
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
|
-
|
|
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:
|
|
5733
|
+
unreadIndicator: hasUnread
|
|
5733
5734
|
};
|
|
5734
5735
|
};
|
|
5735
5736
|
|