From a3de75127aecc0ec3987c53bf3d067aff07e6ab1 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Mon, 27 Jun 2016 10:24:27 +0300 Subject: [PATCH] loading of console's commands.js without running server --- src/status_im/commands/handlers/loading.cljs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/status_im/commands/handlers/loading.cljs b/src/status_im/commands/handlers/loading.cljs index 74b08e7d86..417175bc8a 100644 --- a/src/status_im/commands/handlers/loading.cljs +++ b/src/status_im/commands/handlers/loading.cljs @@ -1,4 +1,5 @@ (ns status-im.commands.handlers.loading + (:require-macros [status-im.utils.slurp :refer [slurp]]) (:require [re-frame.core :refer [register-handler after dispatch subscribe trim-v debug]] [status-im.utils.handlers :as u] @@ -23,9 +24,11 @@ (defn fetch-commands! [db [identity]] (when-let [url (:dapp-url (get-in db [:chats identity]))] - (http-get (s/join "/" [url commands-js]) - #(dispatch [::validate-hash identity %]) - #(dispatch [::loading-failed! identity ::file-was-not-found])))) + (if (= "console" identity) + (dispatch [::validate-hash identity (slurp "resources/commands.js")]) + (http-get (s/join "/" [url commands-js]) + #(dispatch [::validate-hash identity %]) + #(dispatch [::loading-failed! identity ::file-was-not-found]))))) (defn dispatch-loaded! [db [identity file]]