Skip to content

Commit 5271fb7

Browse files
authored
Merge pull request #8094 from NBKelly/temporarily-disable-typing-events
temporarily disable typing events
2 parents fe63db4 + 472232f commit 5271fb7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/cljs/nr/gameboard/log.cljs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@
4949
"Send a typing event to server for this user if it is not already set in game state AND user is not a spectator"
5050
[s]
5151
(r/with-let [typing (r/cursor game-state [:typing])]
52-
(let [text (:msg @s)]
52+
(let [typing? (boolean (seq (:msg @s)))]
5353
(when (and (not (:replay @game-state))
54-
(not @typing)
54+
;; only send if the typing state is different
55+
(or (and (not @typing) typing?)
56+
(and (not typing?) @typing))
5557
(not-spectator?))
5658
(ws/ws-send! [:game/typing {:gameid (current-gameid app-state)
57-
:typing (boolean (seq text))}])))))
59+
:typing typing?}])))))
5860

5961
(defn indicate-action []
6062
(when (not-spectator?)
@@ -140,7 +142,8 @@
140142
(reset-command-menu state)
141143
(swap! state assoc :command-matches (-> e .-target .-value (find-command-matches commands)))
142144
(swap! state assoc :msg (-> e .-target .-value))
143-
(send-typing state))
145+
;;(send-typing state)
146+
)
144147

145148
(defn command-menu [!input-ref state]
146149
(when (show-command-menu? @state)
@@ -179,7 +182,7 @@
179182
:autoComplete "off"
180183
:ref #(reset! !input-ref %)
181184
:value (:msg @state)
182-
:on-blur #(send-typing (atom nil))
185+
;;:on-blur #(send-typing (atom nil))
183186
:on-key-down #(command-menu-key-down-handler state %)
184187
:on-change #(log-input-change-handler state %)}]]]
185188
[indicate-action]

0 commit comments

Comments
 (0)