From 5fe3a1b91aee930fb47b60ceb6122a1c7289e8de Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Fri, 18 Nov 2016 12:19:28 +0200 Subject: [PATCH] add locale and debug props to context object in jail (#459) --- resources/wallet.js | 6 +++++- src/status_im/components/status.cljs | 22 +++++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/resources/wallet.js b/resources/wallet.js index b434af4e13..03e89376d7 100644 --- a/resources/wallet.js +++ b/resources/wallet.js @@ -1,6 +1,10 @@ -function wallet(params) { +function wallet(params, context) { var url = 'http://status.im/dapps/wallet'; + if (context.debug) { + url = 'http://127.0.0.1:3450' + } + if (params.url && params.url !== "undefined" && params.url != "") { url = params.url; if (!/^[a-zA-Z-_]+:/.test(url)) { diff --git a/src/status_im/components/status.cljs b/src/status_im/components/status.cljs index 565ff1448b..886b4633a5 100644 --- a/src/status_im/components/status.cljs +++ b/src/status_im/components/status.cljs @@ -6,7 +6,8 @@ [re-frame.core :refer [dispatch]] [taoensso.timbre :as log] [cljs.core.async :refer [clj r)] - (log/debug r') - (callback r')))] - (.callJail status chat-id (cljs->json path) (cljs->json params) cb)))))) + (log/debug :chat-id chat-id) + (log/debug :path path) + (log/debug :params params) + (let [params' (update params :context assoc + :debug js/goog.DEBUG + :locale i/i18n.locale) + cb (fn [r] + (let [r' (t/json->clj r)] + (log/debug r') + (callback r')))] + (.callJail status chat-id (cljs->json path) (cljs->json params') cb)))))) (defn set-soft-input-mode [mode] (when status