Skip to content

Commit

Permalink
feat: exclude techical socket event listening
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Eberl committed Sep 8, 2021
1 parent 81bedd4 commit 5576060
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/api/rocketChatSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ export class rocketChatSocket {
response.fields.eventName === params[0];
if (changeResponseOnSubscribedEvent) {
const newMessage =
response.collection === SOCKET_COLLECTION.ROOM_MESSAGES;
response.collection === SOCKET_COLLECTION.ROOM_MESSAGES &&
!response.fields.args[0].u.username.starsWith(
'cob-rocket-chat-technical-user'
);
const roomClosed =
response.collection === SOCKET_COLLECTION.NOTIFY_USER &&
response.fields.args &&
Expand Down
6 changes: 3 additions & 3 deletions src/components/session/SessionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ export const SessionView = (props) => {
mobileDetailView();
setAcceptedGroupId(null);
typingTimeout = null;
const isEnquiry = chatItem?.status === 1;
const isCurrentAnonymousEnquiry =
chatItem?.status === 1 &&
chatItem?.registrationType === 'ANONYMOUS';
isEnquiry && chatItem?.registrationType === 'ANONYMOUS';
if (isGroupChat && !chatItem.subscribed) {
setIsLoading(false);
} else if (isCurrentAnonymousEnquiry) {
setIsLoading(false);
setIsAnonymousEnquiry(isCurrentAnonymousEnquiry);
} else {
} else if (!isEnquiry) {
window['socket'] = new rocketChatSocket();
fetchSessionMessages();
return () => {
Expand Down

0 comments on commit 5576060

Please sign in to comment.