Fall back from server generated thumbnail to original image (#10853)

* Add test for falling back from thumbnail to original

* Fall back from server generated thumbnail to original image
This commit is contained in:
Michael Telatynski 2023-05-11 10:20:14 +01:00 committed by GitHub
parent 82e32035fd
commit 949557b5c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 1 deletions

View file

@ -165,6 +165,14 @@ export default class MImageBody extends React.Component<IBodyProps, IState> {
};
private onImageError = (): void => {
// If the thumbnail failed to load then try again using the contentUrl
if (this.state.thumbUrl) {
this.setState({
thumbUrl: null,
});
return;
}
this.clearBlurhashTimeout();
this.setState({
imgError: true,