Page MenuHomePhabricator

[e.cash] Prevent navbar api calls on every page load
ClosedPublic

Authored by johnkuney on Thu, Apr 4, 16:49.

Details

Reviewers
Mengerian
Group Reviewers
Restricted Project
Commits
rABC5c7f9ad23e59: [e.cash] Prevent navbar api calls on every page load
Summary

I noticed the API call for the navbar price display was getting fired on every page load. You can see it happen as the price in the navbar will disappear for a moment when you change pages.

By moving this call to a context provider and passing it through the top app level, we can expose it to the navbar without inefficient api calls.

Test Plan

preview the site and check everything still looks and functions the same, but you should only see the price call happen once, and the numbers wont disappear for a second when you change pages

Note: if you are running locally you'll probably see the call fired twice while in dev mode due to "strict-mode" being on in dev mode

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Mengerian requested changes to this revision.Thu, Apr 4, 17:16

No, the upgrade announcement needs to be there. We literally just released the upgrade release today.

What would be nice is to have an additional countdown for the halving. But the upgrade banner needs to stay.

This revision now requires changes to proceed.Thu, Apr 4, 17:16

updating to include blocks left and upgrade notice as discussed

johnkuney edited the test plan for this revision. (Show Details)
Mengerian requested changes to this revision.Fri, Apr 5, 01:00

The preview looks fine, but the Diff is a bit confusing to review because it seems to be doing to logically distinct things: 1) reorganizing code into "getNavbarData" and 2) adding the halving countdown. Could you separate it into 2 diffs?

web/e.cash/components/navbar/getNavbarData.js
1 ↗(On Diff #46848)
This revision now requires changes to proceed.Fri, Apr 5, 01:00
johnkuney edited the summary of this revision. (Show Details)
johnkuney edited the test plan for this revision. (Show Details)

remove blockheight info

yeah fair enough, I've reduced this one to just the api context provider, will add the new banner next. Will update this title and description

johnkuney retitled this revision from [e.cash] Add halving info to announcement bar to [e.cash] Prevent navbar api calls on every page load.Fri, Apr 5, 15:58
johnkuney edited the summary of this revision. (Show Details)
johnkuney edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Fri, Apr 5, 19:56