Adds logic around downloading stories

This commit is contained in:
Josh Perez 2022-03-28 21:10:08 -04:00 committed by GitHub
parent 9d3f0072a5
commit 3b5cc26fec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 645 additions and 149 deletions

View file

@ -8,7 +8,10 @@ import { Blurhash } from 'react-blurhash';
import { Spinner } from '../Spinner';
import type { LocalizerType, ThemeType } from '../../types/Util';
import type { AttachmentType } from '../../types/Attachment';
import { hasNotDownloaded, defaultBlurHash } from '../../types/Attachment';
import {
isDownloaded as isDownloadedFunction,
defaultBlurHash,
} from '../../types/Attachment';
export type Props = {
alt: string;
@ -169,7 +172,7 @@ export class Image extends React.Component<Props> {
const canClick = this.canClick();
const imgNotDownloaded = isDownloaded
? false
: hasNotDownloaded(attachment);
: !isDownloadedFunction(attachment);
const resolvedBlurHash = blurHash || defaultBlurHash(theme);