Merge pull request #479 from status-im/bug/#471

Fix command/request message locking
This commit is contained in:
Roman Volosovskyi 2016-11-21 17:11:51 +02:00 committed by GitHub
commit adfd3ac2c4
3 changed files with 9 additions and 3 deletions

View File

@ -318,7 +318,11 @@
[{:keys [current-chat-id] :as db} [_ _ id]] [{:keys [current-chat-id] :as db} [_ _ id]]
(let [chat-id (or id current-chat-id) (let [chat-id (or id current-chat-id)
messages (get-in db [:chats chat-id :messages]) messages (get-in db [:chats chat-id :messages])
db' (assoc db :current-chat-id chat-id) command? (= :command (get-in db [:edit-mode chat-id]))
db' (-> db
(assoc :current-chat-id chat-id)
(update-in [:animations :to-response-height chat-id]
#(if command? % 0)))
commands-loaded? (if js/goog.DEBUG commands-loaded? (if js/goog.DEBUG
false false
(get-in db [:chats chat-id :commands-loaded]))] (get-in db [:chats chat-id :commands-loaded]))]

View File

@ -45,7 +45,8 @@
:sync-state :done :sync-state :done
:sync-listener nil :sync-listener nil
:status-module-initialized? js/goog.DEBUG}) :status-module-initialized? js/goog.DEBUG
:edit-mode {}})
(defn chat-staged-commands-path [chat-id] (defn chat-staged-commands-path [chat-id]
[:chats chat-id :staged-commands]) [:chats chat-id :staged-commands])

View File

@ -51,7 +51,8 @@
(register-handler :initialize-account-db (register-handler :initialize-account-db
(fn [db _] (fn [db _]
(assoc db :current-chat-id console-chat-id))) (assoc db :current-chat-id console-chat-id
:edit-mode nil)))
(register-handler :initialize-account (register-handler :initialize-account
(u/side-effect! (u/side-effect!