Skip to content

Commit

Permalink
fix: Promise.finally() is not supported on FF even with babel polyfills
Browse files Browse the repository at this point in the history
  • Loading branch information
goldoraf authored and y-lohse committed Jan 5, 2018
1 parent 3472238 commit a43e28e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"chrome": 42,
"browsers": ["last 2 versions"]
},
"useBuiltIns": true
"useBuiltIns": true,
"shippedProposals": true
}],
"react"
],
Expand Down
10 changes: 7 additions & 3 deletions src/sharing/components/ShareByEmail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,18 @@ class ShareByEmail extends Component {
count: recipients.length
})
}
this.reset()
})
.catch(err => {
Alerter.error('Error.generic')
throw err
})
.finally(() => {
this.reset()
throw err
})
// TODO: We'd like to use finally here but unfortunately it doesn't work on FF
// even with the `shippedProposals` option to babel-preset-env
// .finally(() => {
// this.reset()
// })
}

render() {
Expand Down

0 comments on commit a43e28e

Please sign in to comment.