Skip to content

Commit 34b7702

Browse files
committed
another attempt to fix status-im#1088
1 parent 07c247b commit 34b7702

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

bots/browse/bot.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
function browse(params, context) {
22
var url;
33

4+
if (params.metadata && params.metadata.url
5+
&& params.metadata.url !== "undefined" && params.metadata.url != "") {
6+
url = params.metadata.url;
7+
}
8+
49
if (params.url && params.url !== "undefined" && params.url != "") {
510
url = params.url;
6-
if (!/^[a-zA-Z-_]+:/.test(url)) {
7-
url = 'http://' + url;
8-
}
11+
}
12+
13+
if (url && !/^[a-zA-Z-_]+:/.test(url)) {
14+
url = 'http://' + url;
915
}
1016

1117
return {

src/status_im/chat/handlers/input.cljs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@
164164
;:check-and-load-commands!
165165
(let [params
166166
{:command command
167-
:chat-id jail-id}
167+
:chat-id chat-id
168+
:jail-id jail-id}
168169

169170
on-send-params
170171
(merge params
@@ -230,7 +231,7 @@
230231
(handlers/side-effect!
231232
(fn [{:keys [contacts] :as db}
232233
[_ {{:keys [command metadata args] :as c} :command
233-
:keys [message-id chat-id data-type after]}]]
234+
:keys [message-id chat-id jail-id data-type after]}]]
234235
(let [{:keys [dapp? dapp-url name]} (get contacts chat-id)
235236
message-id (random/id)
236237
metadata (merge metadata
@@ -244,9 +245,10 @@
244245
:created-at (time/now-ms)
245246
:id message-id
246247
:chat-id chat-id
247-
:jail-id (or (:bot command) chat-id)}
248+
:jail-id jail-id}
248249
request-data {:message-id message-id
249250
:chat-id chat-id
251+
:jail-id jail-id
250252
:content {:command (:name command)
251253
:params (assoc params :metadata metadata)
252254
:type (:type command)}

src/status_im/commands/handlers/loading.cljs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@
199199
(reg-handler ::add-commands
200200
[(after save-commands-js!)
201201
(after save-commands!)
202-
(after #(dispatch [:check-and-open-dapp!]))
203202
(after #(dispatch [:update-suggestions]))
204203
(after (fn [_ [id]]
205204
(dispatch [:invoke-commands-loading-callbacks id])

0 commit comments

Comments
 (0)