This commit is contained in:
Roman Volosovskyi 2017-05-02 16:25:00 +03:00
parent 561c66084c
commit 72d06426d8
2 changed files with 6 additions and 7 deletions

View File

@ -209,10 +209,9 @@
(when update-db (when update-db
(dispatch [:update-bot-db {:bot chat-id (dispatch [:update-bot-db {:bot chat-id
:db update-db}])) :db update-db}]))
(when markup (dispatch [:suggestions-handler (assoc params
(dispatch [:suggestions-handler (assoc params :result data
:result data :default-db default-db)])
:default-db default-db)]))
(doseq [message log-messages] (doseq [message log-messages]
(let [{:keys [message type]} message] (let [{:keys [message type]} message]
(when (or (not= type "debug") js/goog.DEBUG) (when (or (not= type "debug") js/goog.DEBUG)

View File

@ -40,10 +40,10 @@
(let [{:keys [markup]} (get-in result [:result :returned]) (let [{:keys [markup]} (get-in result [:result :returned])
{:keys [dapp? dapp-url]} (get contacts chat-id) {:keys [dapp? dapp-url]} (get contacts chat-id)
path (if command path (if command
[:chats chat-id :parameter-boxes (:name command) parameter-index :hiccup] [:chats chat-id :parameter-boxes (:name command) parameter-index]
[:chats chat-id :parameter-boxes :message :hiccup])] [:chats chat-id :parameter-boxes :message])]
(when-not (= (get-in db path) markup) (when-not (= (get-in db path) markup)
(dispatch [:set-in path markup]) (dispatch [:set-in path (when markup {:hiccup markup})])
(when default-db (when default-db
(dispatch [:update-bot-db {:bot chat-id (dispatch [:update-bot-db {:bot chat-id
:db default-db}]))))) :db default-db}])))))