[ISSUE #4166] Fixed incorrect DApps name changes

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
Julien Eluard 2018-05-11 14:57:51 +02:00
parent baa9b2ac02
commit 1d196d2e82
No known key found for this signature in database
GPG Key ID: 6FD7DB5437FCBEF6
2 changed files with 6 additions and 6 deletions

View File

@ -26,9 +26,9 @@
(:url browser)
(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)]
{: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}))
(handlers/register-handler-fx
@ -54,7 +54,7 @@
(handlers/register-handler-fx
:update-browser
[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)]
(-> (add-browser-fx cofx new-browser)
(update-in [:db :browser/options] #(assoc % :browser-id (:browser-id new-browser)))))))
@ -62,7 +62,7 @@
(handlers/register-handler-fx
:update-browser-options
[re-frame/trim-v]
(fn [{:keys [db now] :as cofx} [options]]
(fn [{:keys [db]} [options]]
{:db (update db :browser/options merge options)}))
(handlers/register-handler-fx

View File

@ -61,9 +61,9 @@
[components/activity-indicator {:animating true}]]))
(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)
(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}])))
(defn get-inject-js [url]