suggestions from jail
This commit is contained in:
parent
474729f230
commit
77a53cf040
|
@ -61,7 +61,8 @@
|
|||
path
|
||||
params
|
||||
#(dispatch [:suggestions-handler {:command command
|
||||
:content content} %]))))
|
||||
:content content
|
||||
:chat-id current-chat-id} %]))))
|
||||
|
||||
(register-handler :start-cancel-command
|
||||
(u/side-effect!
|
||||
|
|
|
@ -106,6 +106,4 @@
|
|||
|
||||
(register-sub :get-content-suggestions
|
||||
(fn [db _]
|
||||
(let [command (reaction (commands/get-chat-command @db))
|
||||
text (reaction (commands/get-chat-command-content @db))]
|
||||
(reaction (get-content-suggestions @command @text)))))
|
||||
(reaction (get-in @db [:suggestions (:current-chat-id @db)]))))
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
(list-item [suggestion-list-item row]))
|
||||
|
||||
(defview content-suggestions-view []
|
||||
[suggestions [:get :current-suggestion]]
|
||||
[suggestions [:get-content-suggestions]]
|
||||
(when (seq suggestions)
|
||||
[view st/container
|
||||
[touchable-highlight {:style st/drag-down-touchable
|
||||
|
|
|
@ -59,9 +59,9 @@
|
|||
[touchable-highlight {:on-press (fn []
|
||||
(reset! loop? false)
|
||||
(set-chat-command msg-id command))
|
||||
:style st/command-request-image-touchable
|
||||
:style st/command-request-image-touchable}
|
||||
;:accessibility-label (label command)
|
||||
}
|
||||
|
||||
[animated-view {:style (st/command-request-image-view command scale-anim-val)}
|
||||
[image {:source {:uri (:icon command)}
|
||||
:style st/command-request-image}]]])})))
|
||||
|
|
|
@ -32,7 +32,4 @@
|
|||
(defview response-suggestions-view []
|
||||
[suggestions [:get-content-suggestions]]
|
||||
(when (seq suggestions)
|
||||
[view st/suggestions-container
|
||||
[list-view {:dataSource (to-datasource suggestions)
|
||||
:keyboardShouldPersistTaps true
|
||||
:renderRow render-row}]]))
|
||||
suggestions))
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
(apply handler params))))
|
||||
|
||||
(defn suggestions-handler
|
||||
[db [_ response-json]]
|
||||
[db [{:keys [chat-id]} response-json]]
|
||||
(let [response (json->cljs response-json)]
|
||||
(assoc db :current-suggestion (generate-hiccup response))))
|
||||
(assoc-in db [:suggestions chat-id] (generate-hiccup response))))
|
||||
|
||||
(defn suggestions-events-handler!
|
||||
[db [[n data]]]
|
||||
|
|
Loading…
Reference in New Issue