From 5af33a99caa3840d9865bd15b92e78918ebff59e Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Wed, 29 Jun 2016 11:55:56 +0300 Subject: [PATCH] fix responses animation --- src/status_im/chat/handlers.cljs | 10 +++++++--- src/status_im/chat/handlers/animation.cljs | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/status_im/chat/handlers.cljs b/src/status_im/chat/handlers.cljs index a5af15c8a1..d5d5a1d63b 100644 --- a/src/status_im/chat/handlers.cljs +++ b/src/status_im/chat/handlers.cljs @@ -78,11 +78,13 @@ [(after invoke-suggestions-handler!) (after cancel-command!)] (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 (commands/set-chat-command-content db content) (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 [{:keys [current-chat-id] :as db} text] @@ -128,7 +130,9 @@ [(after invoke-suggestions-handler!) (after #(dispatch [:command-edit-mode]))] (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 [{:keys [current-chat-id] :as db} [_ text]] diff --git a/src/status_im/chat/handlers/animation.cljs b/src/status_im/chat/handlers/animation.cljs index ec9f40289c..4ae299dc71 100644 --- a/src/status_im/chat/handlers/animation.cljs +++ b/src/status_im/chat/handlers/animation.cljs @@ -52,6 +52,7 @@ height (if suggestions? middle-height (get-minimum-height db))] + (println "hei" suggestions? ) (assoc-in db [:animations :to-response-height] height)))) (defn fix-height