Skip to content

Commit

Permalink
Update airgrab data based on account/chain swaps
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Mar 3, 2019
1 parent e9f445e commit 62a3568
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/shared/components/Tools/Airgrabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ class ToolsAirgrabs extends PureComponent<Props> {
}

componentDidUpdate(prevProps) {
const { app } = this.props;
const { app, settings } = this.props;

const currentAirgrabs = get(app, 'constants.airgrabs') || [];
const prevAirgrabs = get(prevProps.app, 'constants.airgrabs') || [];

if (currentAirgrabs.length !== prevAirgrabs.length) {
if (
currentAirgrabs.length !== prevAirgrabs.length
|| settings.account !== prevProps.settings.account
|| settings.chainId !== prevProps.settings.chainId
) {
this.fetchAirgrabsData();
}
}
Expand Down

0 comments on commit 62a3568

Please sign in to comment.