Merge pull request #263 from status-im/fix/metamask-address-not-updated-#187
[FIX #187] Fix issue with "Select address" appearing after refresh
This commit is contained in:
commit
714b869a72
|
@ -4,6 +4,7 @@
|
|||
(def default-db
|
||||
{:page :bounties
|
||||
:user nil
|
||||
:user-profile-loaded? false
|
||||
:repos-loading? false
|
||||
:repos {}
|
||||
:activity-feed-loading? false
|
||||
|
|
|
@ -225,7 +225,8 @@
|
|||
:set-user-profile
|
||||
(fn [{:keys [db]} [_ user-profile]]
|
||||
{:db
|
||||
(assoc db :user (:user user-profile))
|
||||
(assoc db :user (:user user-profile)
|
||||
:user-profile-loaded? true)
|
||||
:dispatch-n [[:load-user-repos]
|
||||
[:load-owner-bounties]]}))
|
||||
|
||||
|
|
|
@ -19,6 +19,11 @@
|
|||
(fn [db _]
|
||||
(:user db)))
|
||||
|
||||
(reg-sub
|
||||
:user-profile-loaded?
|
||||
(fn [db _]
|
||||
(:user-profile-loaded? db)))
|
||||
|
||||
(reg-sub
|
||||
:repos-loading?
|
||||
(fn [db _]
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
[reagent.crypt :as crypt]
|
||||
[cljs-web3.eth :as web3-eth]))
|
||||
|
||||
|
||||
(defn update-address-page []
|
||||
(defn update-address-page-contents []
|
||||
(let [db (rf/subscribe [:db])
|
||||
user (rf/subscribe [:user])
|
||||
updating-address (rf/subscribe [:get-in [:updating-address]])
|
||||
|
@ -42,3 +41,11 @@
|
|||
(when @updating-address
|
||||
" busy loading"))})
|
||||
"UPDATE"]]]))))
|
||||
|
||||
(defn update-address-page []
|
||||
(let [loaded? @(rf/subscribe [:user-profile-loaded?])]
|
||||
(if loaded?
|
||||
[update-address-page-contents]
|
||||
[:div.view-loading-container
|
||||
[:div.ui.active.inverted.dimmer
|
||||
[:div.ui.text.loader.view-loading-label "Loading"]]])))
|
||||
|
|
Loading…
Reference in New Issue