[FIX] Ignore self typing event (#1950)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Djorkaeff Alexandre 2020-03-26 13:59:11 -03:00 committed by GitHub
parent 77256eb3c0
commit 255254c285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -82,12 +82,15 @@ export default class RoomSubscription {
return; return;
} }
if (ev === 'typing') { if (ev === 'typing') {
const { user } = reduxStore.getState().login;
const [username, typing] = ddpMessage.fields.args; const [username, typing] = ddpMessage.fields.args;
if (username !== user.username) {
if (typing) { if (typing) {
reduxStore.dispatch(addUserTyping(username)); reduxStore.dispatch(addUserTyping(username));
} else { } else {
reduxStore.dispatch(removeUserTyping(username)); reduxStore.dispatch(removeUserTyping(username));
} }
}
} else if (ev === 'deleteMessage') { } else if (ev === 'deleteMessage') {
InteractionManager.runAfterInteractions(async() => { InteractionManager.runAfterInteractions(async() => {
if (ddpMessage && ddpMessage.fields && ddpMessage.fields.args.length > 0) { if (ddpMessage && ddpMessage.fields && ddpMessage.fields.args.length > 0) {