Skip to content

Commit

Permalink
handle promise rejections (#4983)
Browse files Browse the repository at this point in the history
fix the build
  • Loading branch information
Umar Asghar committed Jul 26, 2021
1 parent 5abb2ad commit 94554ac
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions static/js/containers/DashboardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,18 @@ class DashboardPage extends React.Component {
fetchDashboard() {
const { dashboard, dispatch } = this.props
if (dashboard.fetchStatus === undefined) {
dispatch(fetchDashboard(SETTINGS.user.username))
dispatch(fetchDashboard(SETTINGS.user.username)).catch(() => {
/* Promise rejected */
})
}
}

fetchCoursePrices() {
const { prices, dispatch } = this.props
if (prices.getStatus === undefined) {
dispatch(actions.prices.get(SETTINGS.user.username))
dispatch(actions.prices.get(SETTINGS.user.username)).catch(() => {
/* Promise rejected */
})
}
}

Expand All @@ -317,14 +321,18 @@ class DashboardPage extends React.Component {
program !== undefined &&
R.pathEq([program.id, "getStatus"], undefined, programLearners)
) {
dispatch(actions.programLearners.get(program.id))
dispatch(actions.programLearners.get(program.id)).catch(() => {
/* Promise rejected */
})
}
}

fetchCoupons() {
const { coupons, dispatch } = this.props
if (coupons.fetchGetStatus === undefined) {
dispatch(fetchCoupons())
dispatch(fetchCoupons()).catch(() => {
/* Promise rejected */
})
}
}

Expand Down Expand Up @@ -378,7 +386,9 @@ class DashboardPage extends React.Component {
!discussionsFrontpage.loaded &&
!discussionsFrontpage.processing
) {
dispatch(actions.discussionsFrontpage.get())
dispatch(actions.discussionsFrontpage.get()).catch(() => {
/* Promise rejected */
})
}
}

Expand Down

0 comments on commit 94554ac

Please sign in to comment.