diff --git a/src/libs/Pusher/EventType.js b/src/libs/Pusher/EventType.js index 79e7fb0c5137..a140e04121df 100644 --- a/src/libs/Pusher/EventType.js +++ b/src/libs/Pusher/EventType.js @@ -8,4 +8,5 @@ export default { EXPENSIFY_CARD_UPDATE: 'expensifyCardUpdate', SCREEN_SHARE_REQUEST: 'screenshareRequest', ONYX_API_UPDATE: 'onyxApiUpdate', + USER_IS_TYPING: 'client-userIsTyping', }; diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 3b4f5468f4e7..0bf3c384a5c1 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -109,7 +109,7 @@ function subscribeToReportTypingEvents(reportID) { Onyx.set(`${ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${reportID}`, {}); const pusherChannelName = getReportChannelName(reportID); - Pusher.subscribe(pusherChannelName, 'client-userIsTyping', (typingStatus) => { + Pusher.subscribe(pusherChannelName, Pusher.TYPE.USER_IS_TYPING, (typingStatus) => { const normalizedTypingStatus = getNormalizedTypingStatus(typingStatus); const login = _.first(_.keys(normalizedTypingStatus)); @@ -152,7 +152,7 @@ function unsubscribeFromReportChannel(reportID) { const pusherChannelName = getReportChannelName(reportID); Onyx.set(`${ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${reportID}`, {}); - Pusher.unsubscribe(pusherChannelName); + Pusher.unsubscribe(pusherChannelName, Pusher.TYPE.USER_IS_TYPING); } const defaultNewActionSubscriber = { @@ -629,7 +629,7 @@ function broadcastUserIsTyping(reportID) { const privateReportChannelName = getReportChannelName(reportID); const typingStatus = {}; typingStatus[currentUserEmail] = true; - Pusher.sendEvent(privateReportChannelName, 'client-userIsTyping', typingStatus); + Pusher.sendEvent(privateReportChannelName, Pusher.TYPE.USER_IS_TYPING, typingStatus); } /**