another attempt to fix issue #607

This commit is contained in:
Roman Volosovskyi 2017-01-04 10:58:46 +02:00
parent 13e9283477
commit a0d8c22f84
3 changed files with 7 additions and 3 deletions

View File

@ -362,7 +362,9 @@
(when (= current-chat-id wallet-chat-id) (when (= current-chat-id wallet-chat-id)
(dispatch [:cancel-command])) (dispatch [:cancel-command]))
(dispatch [:load-requests! chat-id]) (dispatch [:load-requests! chat-id])
(if-not commands-loaded? ;; todo rewrite this. temporary fix for https://github.com/status-im/status-react/issues/607
(dispatch [:load-commands! chat-id])
#_(if-not commands-loaded?
(dispatch [:load-commands! chat-id]) (dispatch [:load-commands! chat-id])
(dispatch [:invoke-chat-loaded-callbacks chat-id])) (dispatch [:invoke-chat-loaded-callbacks chat-id]))
(if (and (seq messages) (if (and (seq messages)

View File

@ -20,7 +20,8 @@
(let [identity (or identity current-chat-id) (let [identity (or identity current-chat-id)
contact (or (get contacts identity) contact (or (get contacts identity)
{:whisper-identity identity})] {:whisper-identity identity})]
(dispatch [::fetch-commands! contact])) (when identity
(dispatch [::fetch-commands! contact])))
;; todo uncomment ;; todo uncomment
#_(if-let [{:keys [file]} (commands/get-by-chat-id identity)] #_(if-let [{:keys [file]} (commands/get-by-chat-id identity)]
(dispatch [::parse-commands! identity file]) (dispatch [::parse-commands! identity file])

View File

@ -410,4 +410,5 @@
(let [message (.-message error)] (let [message (.-message error)]
(when (or (re-find (re-pattern "Could not connect to the server.") message) (when (or (re-find (re-pattern "Could not connect to the server.") message)
(re-find (re-pattern "Failed to connect") message)) (re-find (re-pattern "Failed to connect") message))
(status/restart-rpc)))))) (status/restart-rpc)
(dispatch [:load-commands!]))))))