diff --git a/src/status_im/chat/handlers.cljs b/src/status_im/chat/handlers.cljs index 87de93247a..d2f9360062 100644 --- a/src/status_im/chat/handlers.cljs +++ b/src/status_im/chat/handlers.cljs @@ -362,7 +362,9 @@ (when (= current-chat-id wallet-chat-id) (dispatch [:cancel-command])) (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 [:invoke-chat-loaded-callbacks chat-id])) (if (and (seq messages) diff --git a/src/status_im/commands/handlers/loading.cljs b/src/status_im/commands/handlers/loading.cljs index aae6f215e6..17179b3cb7 100644 --- a/src/status_im/commands/handlers/loading.cljs +++ b/src/status_im/commands/handlers/loading.cljs @@ -20,7 +20,8 @@ (let [identity (or identity current-chat-id) contact (or (get contacts identity) {:whisper-identity identity})] - (dispatch [::fetch-commands! contact])) + (when identity + (dispatch [::fetch-commands! contact]))) ;; todo uncomment #_(if-let [{:keys [file]} (commands/get-by-chat-id identity)] (dispatch [::parse-commands! identity file]) diff --git a/src/status_im/protocol/handlers.cljs b/src/status_im/protocol/handlers.cljs index 598df8940e..b16ad3c288 100644 --- a/src/status_im/protocol/handlers.cljs +++ b/src/status_im/protocol/handlers.cljs @@ -410,4 +410,5 @@ (let [message (.-message error)] (when (or (re-find (re-pattern "Could not connect to the server.") message) (re-find (re-pattern "Failed to connect") message)) - (status/restart-rpc)))))) + (status/restart-rpc) + (dispatch [:load-commands!]))))))