smartcar / javascript-sdk

Client-side JS SDK for OAuth dialogs.
MIT License
9 stars 5 forks source link

fix: remove hasBeenInstantiated flag checks #50

Closed gurpreetatwal closed 4 years ago

gurpreetatwal commented 4 years ago

There is not a need for an explicit check on how many times the Smartcar class has been instantiated.

This fix stems from an error that occurs when the onComplete callback is triggered with only one parameter. ReactDOM will swallow the thrown error that's triggered and run React's resetContextDependencies function to replay the event on a separate thread to verify that an error has been thrown.

The result of this triggers a reload of the component, which then triggers the hasBeenInstantiated error.

codecov[bot] commented 4 years ago

Codecov Report

Merging #50 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #50   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines          15     15           
  Branches        2      2           
=====================================
  Hits           15     15

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b7c6c61...4df8604. Read the comment docs.