Support for commands.js file inside DApps

This commit is contained in:
alwx 2017-02-28 15:51:31 +03:00 committed by Roman Volosovskyi
parent d6f43d3248
commit eb15c0a4eb
2 changed files with 13 additions and 15 deletions

View File

@ -31,6 +31,7 @@ var TopLevel = {
"create" : function () {}, "create" : function () {},
"createAccount" : function () {}, "createAccount" : function () {},
"data" : function () {}, "data" : function () {},
"DataSource" : function () {},
"Date" : function () {}, "Date" : function () {},
"DEBUG" : function () {}, "DEBUG" : function () {},
"decay" : function () {}, "decay" : function () {},
@ -97,6 +98,7 @@ var TopLevel = {
"layout" : function () {}, "layout" : function () {},
"length" : function () {}, "length" : function () {},
"Linking" : function () {}, "Linking" : function () {},
"ListView" : function () {},
"locale" : function () {}, "locale" : function () {},
"lockToPortrait" : function () {}, "lockToPortrait" : function () {},
"log" : function () {}, "log" : function () {},

View File

@ -28,24 +28,20 @@
(defn fetch-commands! (defn fetch-commands!
[_ [{:keys [whisper-identity dapp? dapp-url]}]] [_ [{:keys [whisper-identity dapp? dapp-url]}]]
(when true (cond
;-let [url (get-in db [:chats identity :dapp-url])] (= console-chat-id whisper-identity)
(cond (dispatch [::validate-hash whisper-identity js-res/console-js])
(= console-chat-id whisper-identity)
(dispatch [::validate-hash whisper-identity js-res/console-js])
(= wallet-chat-id whisper-identity) (= wallet-chat-id whisper-identity)
(dispatch [::validate-hash whisper-identity js-res/wallet-js]) (dispatch [::validate-hash whisper-identity js-res/wallet-js])
(and dapp? dapp-url) (and dapp? dapp-url)
(dispatch [::validate-hash whisper-identity js-res/dapp-js]) (http-get (s/join "/" [dapp-url commands-js])
#(dispatch [::validate-hash whisper-identity %])
#(dispatch [::validate-hash whisper-identity js-res/dapp-js]))
:else :else
(dispatch [::validate-hash whisper-identity js-res/commands-js]) (dispatch [::validate-hash whisper-identity js-res/commands-js])))
#_(http-get (s/join "/" [url commands-js])
#(dispatch [::validate-hash identity %])
#(dispatch [::loading-failed! identity ::file-was-not-found])))))
(defn dispatch-loaded! (defn dispatch-loaded!
[db [identity file]] [db [identity file]]