This commit is contained in:
Roman Volosovskyi 2016-11-21 12:01:01 +02:00
parent a62c4b1c78
commit 5bf8cebb83
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!