[Glitch] Add missing rejection handling for Promises
Port missing parts from 2c51bc0ca5 to glitch-soc
This commit is contained in:
1 parent
6b2eefc7bf
commit
a963ea67dd
8 files changed
+54
-29
No files matched your search
@@ -10,6 +10,7 @@ export default class EmbedModal extends ImmutablePureComponent {
|
||||
static propTypes = {
|
||||
url: PropTypes.string.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
onError: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
@@ -35,6 +36,8 @@ export default class EmbedModal extends ImmutablePureComponent {
|
||||
iframeDocument.body.style.margin = 0;
|
||||
this.iframe.width = iframeDocument.body.scrollWidth;
|
||||
this.iframe.height = iframeDocument.body.scrollHeight;
|
||||
}).catch(error => {
|
||||
this.props.onError(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user