Conform src/components/views/messages/* code to strictNullChecks (#10461)

This commit is contained in:
Michael Telatynski 2023-03-29 08:22:35 +01:00 committed by GitHub
parent 7cb90d0f78
commit cefd94859c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 109 additions and 96 deletions

View file

@ -63,17 +63,17 @@ export default class DownloadActionButton extends React.PureComponent<IProps, IS
if (this.state.blob) {
// Cheat and trigger a download, again.
return this.doDownload();
return this.doDownload(this.state.blob);
}
const blob = await this.props.mediaEventHelperGet().sourceBlob.value;
this.setState({ blob });
await this.doDownload();
await this.doDownload(blob);
};
private async doDownload(): Promise<void> {
private async doDownload(blob: Blob): Promise<void> {
await this.downloader.download({
blob: this.state.blob,
blob,
name: this.props.mediaEventHelperGet().fileName,
});
this.setState({ loading: false });