2
0
Эх сурвалжийг харах

Merge pull request #359 from floriancargoet/fix/chat_state_timeout

Fix a timeout bug in chat state notifications
JC Brand 10 жил өмнө
parent
commit
b7933449cc
1 өөрчлөгдсөн 5 нэмэгдсэн , 6 устгасан
  1. 5 6
      converse.js

+ 5 - 6
converse.js

@@ -1243,12 +1243,11 @@
                  *    (string) state - The chat state (consts ACTIVE, COMPOSING, PAUSED, INACTIVE, GONE)
                  *    (no_save) no_save - Just do the cleanup or setup but don't actually save the state.
                  */
-                if (_.contains([ACTIVE, INACTIVE, GONE], state)) {
-                    if (typeof this.chat_state_timeout !== 'undefined') {
-                        clearTimeout(this.chat_state_timeout);
-                        delete this.chat_state_timeout;
-                    }
-                } else if (state === COMPOSING) {
+                if (typeof this.chat_state_timeout !== 'undefined') {
+                    clearTimeout(this.chat_state_timeout);
+                    delete this.chat_state_timeout;
+                }
+                if (state === COMPOSING) {
                     this.chat_state_timeout = setTimeout(
                             $.proxy(this.setChatState, this), converse.TIMEOUTS.PAUSED, PAUSED);
                 } else if (state === PAUSED) {