fix responses animation

This commit is contained in:
Roman Volosovskyi 2016-06-29 11:55:56 +03:00
parent 471f637e0d
commit 5af33a99ca
2 changed files with 8 additions and 3 deletions

View File

@ -78,11 +78,13 @@
[(after invoke-suggestions-handler!) [(after invoke-suggestions-handler!)
(after cancel-command!)] (after cancel-command!)]
(fn [{:keys [current-chat-id] :as db} [_ content]] (fn [{:keys [current-chat-id] :as db} [_ content]]
(let [starts-as-command? (str/starts-with? content command-prefix)] (let [starts-as-command? (str/starts-with? content command-prefix)
path [:chats current-chat-id :command-input :command :type]
command? (= :command (get-in db path))]
(as-> db db (as-> db db
(commands/set-chat-command-content db content) (commands/set-chat-command-content db content)
(assoc-in db [:chats current-chat-id :input-text] nil) (assoc-in db [:chats current-chat-id :input-text] nil)
(assoc db :canceled-command (not starts-as-command?)))))) (assoc db :canceled-command (and command? (not starts-as-command?)))))))
(defn update-input-text (defn update-input-text
[{:keys [current-chat-id] :as db} text] [{:keys [current-chat-id] :as db} text]
@ -128,7 +130,9 @@
[(after invoke-suggestions-handler!) [(after invoke-suggestions-handler!)
(after #(dispatch [:command-edit-mode]))] (after #(dispatch [:command-edit-mode]))]
(fn [db [_ to-msg-id command-key]] (fn [db [_ to-msg-id command-key]]
(commands/set-response-chat-command db to-msg-id command-key))) (-> db
(commands/set-response-chat-command to-msg-id command-key)
(assoc :canceled-command false))))
(defn update-text (defn update-text
[{:keys [current-chat-id] :as db} [_ text]] [{:keys [current-chat-id] :as db} [_ text]]

View File

@ -52,6 +52,7 @@
height (if suggestions? height (if suggestions?
middle-height middle-height
(get-minimum-height db))] (get-minimum-height db))]
(println "hei" suggestions? )
(assoc-in db [:animations :to-response-height] height)))) (assoc-in db [:animations :to-response-height] height))))
(defn fix-height (defn fix-height