Skip to content

Commit 4b55e1a

Browse files
authored
refactor: the latest version of convertFileSrc is the sync method (#980)
1 parent 5f41b1a commit 4b55e1a

File tree

1 file changed

+1
-11
lines changed
  • src/pages/Clipboard/Panel/components/List/components/Item/components/Image

1 file changed

+1
-11
lines changed

src/pages/Clipboard/Panel/components/List/components/Item/components/Image/index.tsx

+1-11
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,7 @@ interface ImageProps extends Partial<HistoryTablePayload> {
99
const Image: FC<ImageProps> = (props) => {
1010
const { value = "", className = "max-h-full" } = props;
1111

12-
const [src, setSrc] = useState("");
13-
14-
useAsyncEffect(async () => {
15-
if (!value) return;
16-
17-
const src = await convertFileSrc(value);
18-
19-
setSrc(src);
20-
}, [value]);
21-
22-
return <img src={src} className={className} />;
12+
return <img src={convertFileSrc(value)} className={className} />;
2313
};
2414

2515
export default memo(Image);

0 commit comments

Comments
 (0)