Skip to content

Commit

Permalink
Merge pull request #14526 from Prince-Mendiratta/pusher-error-fix
Browse files Browse the repository at this point in the history
proper pusher event type for user typing event
  • Loading branch information
chiragsalian authored Jan 27, 2023
2 parents 1050d9f + 8481f23 commit 142fbba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/libs/Pusher/EventType.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export default {
EXPENSIFY_CARD_UPDATE: 'expensifyCardUpdate',
SCREEN_SHARE_REQUEST: 'screenshareRequest',
ONYX_API_UPDATE: 'onyxApiUpdate',
USER_IS_TYPING: 'client-userIsTyping',
};
6 changes: 3 additions & 3 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 142fbba

Please sign in to comment.