Change `failed` from `?string` to `boolean` in PendingMultimediaUpload`. This diff also adds an optional `failureMessage` prop to `PendingMultimediaUpload` to store the error message in case `failed` is `true`.
This is part of an effort to refactor `InputStateContainer` since some of its logic is confusing. More context [[ https://phab.comm.dev/D4877#141648 | here ]]. The main reason why `failed` was confusing is highlighted in the linked comment, but this section made little sense when `failed` was a `string`:
```
lang=js, name=input-state-container.react.js
uploadInProgress = () => {
if (this.props.ongoingMessageCreation) {
return true;
}
for (const localMessageID in this.state.pendingUploads) {
const messagePendingUploads = this.state.pendingUploads[localMessageID];
for (const localUploadID in messagePendingUploads) {
const { failed } = messagePendingUploads[localUploadID];
if (!failed) {
return true;
}
}
}
return false;
}
```
Now that `failed` is a `boolean`, if `!failed` is `true`, that means that there is a non-failed upload (since `failed` is `false`), which means it is in progress. If every single pending upload's `failed` prop is `true`, then no uploads are in progress.