Andrey Shovkoplyas 2017-06-14 19:16:22 +03:00 committed by Roman Volosovskyi
parent 7da40ce7fa
commit 63bf882e65
2 changed files with 8 additions and 4 deletions

View File

@ -487,7 +487,9 @@
(when dapp-url
(am/go
(dispatch [:select-chat-input-command
(assoc (:browse global-commands) :prefill [dapp-url])])
(assoc (:browse global-commands) :prefill [dapp-url])
nil
true])
(a/<! (a/timeout 100))
(dispatch [:send-current-message])))))))

View File

@ -39,7 +39,7 @@
:select-chat-input-command
(handlers/side-effect!
(fn [{:keys [current-chat-id chat-ui-props] :as db}
[_ {:keys [prefill sequential-params] :as command} metadata]]
[_ {:keys [prefill sequential-params] :as command} metadata prevent-auto-focus?]]
(dispatch [:set-chat-input-text (str (chat-utils/command-name command)
const/spacing-char
(when-not sequential-params
@ -51,10 +51,12 @@
(dispatch [:load-chat-parameter-box command 0])
(if sequential-params
(js/setTimeout
#(do (dispatch [:chat-input-focus :seq-input-ref])
#(do (when-not prevent-auto-focus?
(dispatch [:chat-input-focus :seq-input-ref]))
(dispatch [:set-chat-seq-arg-input-text (str/join const/spacing-char prefill)]))
100)
(dispatch [:chat-input-focus :input-ref])))))
(when-not prevent-auto-focus?
(dispatch [:chat-input-focus :input-ref]))))))
(handlers/register-handler
:set-chat-input-metadata