rendering of a new request in list

This commit is contained in:
Roman Volosovskyi 2016-06-30 11:12:10 +03:00
parent 0761a1da1b
commit 952d3736c8
3 changed files with 10 additions and 9 deletions

View File

@ -29,9 +29,7 @@
:status "open"})
(realm/sorted :added :desc)
(realm/collection->map))
requests' (->> requests
(map #(update % :type keyword))
(into '()))]
requests' (map #(update % :type keyword) requests)]
(assoc-in db [:chats chat-id' :requests] requests')))
(register-handler :add-request

View File

@ -37,8 +37,11 @@
[text {:style st/request-message-info}
"By console, today at 14:50"]]]])
(defn render-request-row [row _ _]
(list-item [request-item row]))
(defn render-request-row
[{:keys [chat-id message-id] :as row} _ _]
(list-item
^{:key [chat-id message-id]}
[request-item row]))
(defn suggestion-list-item
[[command {:keys [description]

View File

@ -91,13 +91,13 @@
(reg-handler ::fetch-commands! (u/side-effect! fetch-commands!))
(reg-handler ::validate-hash
(after dispatch-loaded!)
validate-hash)
(after dispatch-loaded!)
validate-hash)
(reg-handler ::parse-commands! (u/side-effect! parse-commands!))
(reg-handler ::add-commands
(after save-commands-js!)
add-commands)
(after save-commands-js!)
add-commands)
(reg-handler ::loading-failed! (u/side-effect! loading-failed!))