composer: show error bubble on file upload error
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user