mirror of
https://github.com/status-im/open-bounty.git
synced 2025-02-17 11:56:30 +00:00
Smoother background fetching of data
* do not show loading spinner after periodic open bounty and activity data fetches
This commit is contained in:
parent
b0db973fa6
commit
6dd88874f6
@ -261,11 +261,11 @@
|
||||
js/adminToken])))
|
||||
(reset! active-user nil)))
|
||||
|
||||
(defn load-data []
|
||||
(defn load-data [initial-load?]
|
||||
(doall (map rf/dispatch
|
||||
[[:load-open-bounties]
|
||||
[:load-activity-feed]
|
||||
[:load-top-hunters]]))
|
||||
[[:load-open-bounties initial-load?]
|
||||
[:load-activity-feed initial-load?]
|
||||
[:load-top-hunters initial-load?]]))
|
||||
(load-user))
|
||||
|
||||
(defonce timer-id (r/atom nil))
|
||||
@ -273,7 +273,7 @@
|
||||
(defn on-js-load []
|
||||
(when-not (nil? @timer-id)
|
||||
(js/clearInterval @timer-id))
|
||||
(reset! timer-id (js/setInterval load-data 60000))
|
||||
(reset! timer-id (js/setInterval #(load-data false) 60000))
|
||||
(mount-components))
|
||||
|
||||
(defn init! []
|
||||
@ -283,5 +283,5 @@
|
||||
(enable-re-frisk!))
|
||||
(load-interceptors!)
|
||||
(hook-browser-navigation!)
|
||||
(load-data)
|
||||
(load-data true)
|
||||
(on-js-load))
|
||||
|
@ -145,8 +145,10 @@
|
||||
|
||||
(reg-event-fx
|
||||
:load-activity-feed
|
||||
(fn [{:keys [db]} [_]]
|
||||
{:db (assoc db :activity-feed-loading? true)
|
||||
(fn [{:keys [db]} [_ initial-load?]]
|
||||
{:db (if initial-load?
|
||||
(assoc db :activity-feed-loading? true)
|
||||
db)
|
||||
:http {:method GET
|
||||
:url "/api/activity-feed"
|
||||
:on-success #(dispatch [:set-activity-feed %])}}))
|
||||
@ -161,8 +163,10 @@
|
||||
|
||||
(reg-event-fx
|
||||
:load-open-bounties
|
||||
(fn [{:keys [db]} [_]]
|
||||
{:db (assoc db :open-bounties-loading? true)
|
||||
(fn [{:keys [db]} [_ initial-load?]]
|
||||
{:db (if initial-load?
|
||||
(assoc db :open-bounties-loading? true)
|
||||
db)
|
||||
:http {:method GET
|
||||
:url "/api/open-bounties"
|
||||
:on-success #(dispatch [:set-open-bounties %])}}))
|
||||
|
Loading…
x
Reference in New Issue
Block a user