[ISSUE #4166] Fixed incorrect DApps name changes
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
parent
baa9b2ac02
commit
1d196d2e82
|
@ -26,9 +26,9 @@
|
||||||
(:url browser)
|
(:url browser)
|
||||||
(update :url match-url)))
|
(update :url match-url)))
|
||||||
|
|
||||||
(defn add-browser-fx [{:keys [db now] :as cofx} browser]
|
(defn add-browser-fx [{:keys [db now]} browser]
|
||||||
(let [new-browser (get-new-browser browser now)]
|
(let [new-browser (get-new-browser browser now)]
|
||||||
{:db (update-in db [:browser/browsers (:browser-id new-browser)] merge new-browser)
|
{:db (update-in db [:browser/browsers (:browser-id new-browser)] merge new-browser)
|
||||||
:data-store/save-browser new-browser}))
|
:data-store/save-browser new-browser}))
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:update-browser
|
:update-browser
|
||||||
[re-frame/trim-v]
|
[re-frame/trim-v]
|
||||||
(fn [{:keys [db now] :as cofx} [browser]]
|
(fn [{:keys [now] :as cofx} [browser]]
|
||||||
(let [new-browser (get-new-browser browser now)]
|
(let [new-browser (get-new-browser browser now)]
|
||||||
(-> (add-browser-fx cofx new-browser)
|
(-> (add-browser-fx cofx new-browser)
|
||||||
(update-in [:db :browser/options] #(assoc % :browser-id (:browser-id new-browser)))))))
|
(update-in [:db :browser/options] #(assoc % :browser-id (:browser-id new-browser)))))))
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:update-browser-options
|
:update-browser-options
|
||||||
[re-frame/trim-v]
|
[re-frame/trim-v]
|
||||||
(fn [{:keys [db now] :as cofx} [options]]
|
(fn [{:keys [db]} [options]]
|
||||||
{:db (update db :browser/options merge options)}))
|
{:db (update db :browser/options merge options)}))
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
|
|
|
@ -61,9 +61,9 @@
|
||||||
[components/activity-indicator {:animating true}]]))
|
[components/activity-indicator {:animating true}]]))
|
||||||
|
|
||||||
(defn on-navigation-change [event browser]
|
(defn on-navigation-change [event browser]
|
||||||
(let [{:strs [url title canGoBack canGoForward]} (js->clj event)]
|
(let [{:strs [url canGoBack canGoForward]} (js->clj event)]
|
||||||
(when-not (= "about:blank" url)
|
(when-not (= "about:blank" url)
|
||||||
(re-frame/dispatch [:update-browser (assoc browser :url url :name title)]))
|
(re-frame/dispatch [:update-browser (assoc browser :url url)]))
|
||||||
(re-frame/dispatch [:update-browser-options {:can-go-back? canGoBack :can-go-forward? canGoForward}])))
|
(re-frame/dispatch [:update-browser-options {:can-go-back? canGoBack :can-go-forward? canGoForward}])))
|
||||||
|
|
||||||
(defn get-inject-js [url]
|
(defn get-inject-js [url]
|
||||||
|
|
Loading…
Reference in New Issue