Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binance widget no longer disconnects when offline. #5275

Merged
merged 1 commit into from
Apr 17, 2020
Merged

Conversation

ryanml
Copy link
Contributor

@ryanml ryanml commented Apr 16, 2020

Also by consequence convert timers reset appropriately when dropping network connection.

Fixes: brave/brave-browser#9254
Fixes: brave/brave-browser#9253

Submitter Checklist:

Test Plan:

Defined in issues.

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

… offline

Fixes brave/brave-browser#9254 - Fixes convert time issues when going offline
@ryanml ryanml added this to the 1.9.x - Nightly milestone Apr 16, 2020
@ryanml ryanml requested review from bbondy and emerick April 16, 2020 21:50
@ryanml ryanml self-assigned this Apr 16, 2020
@@ -387,7 +387,11 @@ class NewTabPage extends React.Component<Props, State> {

fetchBalance = () => {
chrome.binance.getAccountBalances((balances: Record<string, string>, success: boolean) => {
if (!success) {
const hasBalances = Object.keys(balances).length
Copy link
Contributor Author

@ryanml ryanml Apr 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will always be empty ({}) in an offline response. Also, we shouldn't set auth to invalid if balances simply just don't come in anyway. The success parameter is the correct thing to go off of for that.

Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ryanml ryanml merged commit c8f8da0 into master Apr 17, 2020
@ryanml ryanml deleted the fixes-9253-9254 branch April 17, 2020 04:17
bsclifton pushed a commit that referenced this pull request Apr 21, 2020
Binance widget no longer disconnects when offline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preview conversion doesn't always start from 30sec Widget looses connect state when network is disconnected
3 participants