mirror of
https://github.com/status-im/open-bounty.git
synced 2025-01-11 18:14:25 +00:00
Add :user-profile-loaded? event/sub
This commit is contained in:
parent
8a75d5d68c
commit
8b0622480d
@ -3,6 +3,7 @@
|
|||||||
(def default-db
|
(def default-db
|
||||||
{:page :bounties
|
{:page :bounties
|
||||||
:user nil
|
:user nil
|
||||||
|
:user-profile-loaded? false
|
||||||
:repos-loading? false
|
:repos-loading? false
|
||||||
:repos {}
|
:repos {}
|
||||||
:activity-feed-loading? false
|
:activity-feed-loading? false
|
||||||
|
@ -222,7 +222,8 @@
|
|||||||
:set-user-profile
|
:set-user-profile
|
||||||
(fn [{:keys [db]} [_ user-profile]]
|
(fn [{:keys [db]} [_ user-profile]]
|
||||||
{:db
|
{:db
|
||||||
(assoc db :user (:user user-profile))
|
(assoc db :user (:user user-profile)
|
||||||
|
:user-profile-loaded? true)
|
||||||
:dispatch-n [[:load-user-repos]
|
:dispatch-n [[:load-user-repos]
|
||||||
[:load-owner-bounties]]}))
|
[:load-owner-bounties]]}))
|
||||||
|
|
||||||
|
@ -16,6 +16,11 @@
|
|||||||
(fn [db _]
|
(fn [db _]
|
||||||
(:user db)))
|
(:user db)))
|
||||||
|
|
||||||
|
(reg-sub
|
||||||
|
:user-profile-loaded?
|
||||||
|
(fn [db _]
|
||||||
|
(:user-profile-loaded? db)))
|
||||||
|
|
||||||
(reg-sub
|
(reg-sub
|
||||||
:repos-loading?
|
:repos-loading?
|
||||||
(fn [db _]
|
(fn [db _]
|
||||||
|
@ -6,8 +6,7 @@
|
|||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[cljs-web3.eth :as web3-eth]))
|
[cljs-web3.eth :as web3-eth]))
|
||||||
|
|
||||||
|
(defn update-address-page-contents []
|
||||||
(defn update-address-page []
|
|
||||||
(let [db (rf/subscribe [:db])
|
(let [db (rf/subscribe [:db])
|
||||||
user (rf/subscribe [:user])
|
user (rf/subscribe [:user])
|
||||||
updating-address (rf/subscribe [:get-in [:updating-address]])
|
updating-address (rf/subscribe [:get-in [:updating-address]])
|
||||||
@ -55,3 +54,11 @@
|
|||||||
(when @updating-address
|
(when @updating-address
|
||||||
" busy loading"))})
|
" busy loading"))})
|
||||||
"UPDATE"]]]))))
|
"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…
x
Reference in New Issue
Block a user