Fix erroneous pending thumbnail on wall items (#784)

This commit is contained in:
InfiniteTF 2020-09-09 00:37:19 +02:00 committed by GitHub
parent a26151c9a3
commit 19dfa571da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -69,7 +69,10 @@ const Preview: React.FC<{
className={cx("wall-item-media", {
"wall-item-preview": previewType !== "video",
})}
onError={() => setIsMissing(true)}
onError={(error: React.SyntheticEvent<HTMLVideoElement>) => {
// Error code 4 indicates media not found or unsupported
setIsMissing(error.currentTarget.error?.code === 4);
}}
ref={videoElement}
/>
);