-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent max amount from overshooting when selecting ETH. Prevent page…
… from crashing on network switch
- Loading branch information
Showing
12 changed files
with
1,178 additions
and
308 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,46 @@ | ||
import { Component } from 'react' | ||
import RpayFeed from './rpay/RpayFeed' | ||
import RTokenUpdater from './rtoken/updater' | ||
import CollateralYieldUpdater from './updaters/CollateralYieldUpdater' | ||
import PricesUpdater from './updaters/PriceUpdater' | ||
import AccountUpdater from './wallet/updaters/AccountUpdater' | ||
import { TokenBalancesUpdater } from './wallet/updaters/TokenBalancesUpdater' | ||
import { useChainId } from 'wagmi' | ||
|
||
class CatchErrors extends Component<{ children: any }> { | ||
state = { | ||
hasError: false, | ||
} | ||
constructor(props: any) { | ||
super(props) | ||
} | ||
componentDidCatch() { | ||
this.setState({ hasError: true }) | ||
} | ||
|
||
render() { | ||
if (this.state.hasError) { | ||
return null | ||
} | ||
return <>{this.props.children}</> | ||
} | ||
} | ||
/** | ||
* Updater | ||
*/ | ||
const Updater = () => ( | ||
<> | ||
<PricesUpdater /> | ||
<AccountUpdater /> | ||
<RpayFeed /> | ||
<RTokenUpdater /> | ||
<CollateralYieldUpdater /> | ||
<TokenBalancesUpdater /> | ||
</> | ||
) | ||
const Updater = () => { | ||
const id = useChainId() | ||
|
||
return ( | ||
<CatchErrors key={id}> | ||
<PricesUpdater /> | ||
<AccountUpdater /> | ||
<RpayFeed /> | ||
<RTokenUpdater /> | ||
<CollateralYieldUpdater /> | ||
<TokenBalancesUpdater /> | ||
</CatchErrors> | ||
) | ||
} | ||
|
||
export default Updater |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters