Skip to content

Commit

Permalink
Require connectivity before issuing commands
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Mar 3, 2019
1 parent 62a3568 commit be42ac0
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions app/shared/components/Tools/Airgrabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,21 @@ class ToolsAirgrabs extends PureComponent<Props> {
};

fetchAirgrabsData = () => {
const { actions, app, settings, tables } = this.props;
const { actions, app, settings, tables, validate } = this.props;

const airgrabs = get(app, 'constants.airgrabs') || [];
if (validate.NODE === 'SUCCESS') {
actions.getConstants();

airgrabs.forEach((airgrab) => {
const airgrabAccounts = get(tables, `${airgrab.account}.${settings.account}.accounts.rows`) || [];
if (airgrabAccounts.length > 0) {
return;
}
actions.getTable(airgrab.account, settings.account, 'accounts');
});
const airgrabs = get(app, 'constants.airgrabs') || [];

airgrabs.forEach((airgrab) => {
const airgrabAccounts = get(tables, `${airgrab.account}.${settings.account}.accounts.rows`) || [];
if (airgrabAccounts.length > 0) {
return;
}
actions.getTable(airgrab.account, settings.account, 'accounts');
});
}
};

render() {
Expand Down

0 comments on commit be42ac0

Please sign in to comment.