diff --git a/components/app.js b/components/app.js index c08d999..cd4e04f 100644 --- a/components/app.js +++ b/components/app.js @@ -220,6 +220,7 @@ export default class App extends Component { this.handleAddNetworkClick = this.handleAddNetworkClick.bind(this); this.handleNetworkSubmit = this.handleNetworkSubmit.bind(this); this.handleNetworkRemove = this.handleNetworkRemove.bind(this); + this.showError = this.showError.bind(this); this.handleDismissError = this.handleDismissError.bind(this); this.handleAuthSubmit = this.handleAuthSubmit.bind(this); this.handleRegisterSubmit = this.handleRegisterSubmit.bind(this); @@ -2292,6 +2293,7 @@ export default class App extends Component { client=${activeClient} readOnly=${composerReadOnly} onSubmit=${this.handleComposerSubmit} + onError=${this.showError} autocomplete=${this.autocomplete} commandOnly=${commandOnly} maxLen=${privmsgMaxLen} diff --git a/components/composer.js b/components/composer.js index ad5452e..6ad29c0 100644 --- a/components/composer.js +++ b/components/composer.js @@ -185,7 +185,13 @@ export default class Composer extends Component { promises.push(this.uploadFile(file)); } - let urls = await Promise.all(promises); + let urls; + try { + urls = await Promise.all(promises); + } catch (err) { + this.props.onError(new Error("Failed to upload files", { cause: err })); + return; + } this.setState((state) => { if (state.text) {