From 9bd53ad844b66f14080f3a142a419fed1d8bd491 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 10 Aug 2020 16:56:09 +0800 Subject: Do not block when get post data. --- Timeline/ClientApp/src/app/common/BlobImage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Timeline/ClientApp/src/app/common') diff --git a/Timeline/ClientApp/src/app/common/BlobImage.tsx b/Timeline/ClientApp/src/app/common/BlobImage.tsx index 91497705..7e5e2447 100644 --- a/Timeline/ClientApp/src/app/common/BlobImage.tsx +++ b/Timeline/ClientApp/src/app/common/BlobImage.tsx @@ -3,14 +3,16 @@ import React from 'react'; import { ExcludeKey } from '../utilities/type'; const BlobImage: React.FC< - ExcludeKey, 'src'> & { blob?: Blob } + ExcludeKey, 'src'> & { + blob?: Blob | unknown; + } > = (props) => { const { blob, ...otherProps } = props; const [url, setUrl] = React.useState(undefined); React.useEffect(() => { - if (blob != null) { + if (blob instanceof Blob) { const url = URL.createObjectURL(blob); setUrl(url); return () => { -- cgit v1.2.3