From c6d9306c9b0c75541392aa006fc9b7d92e7417e8 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 10 Dec 2024 15:12:19 +0100 Subject: [PATCH] UI: fix reactive RndThumbnail --- .../app/src/components/noiseThumbnail/index.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/webview-ui/app/src/components/noiseThumbnail/index.tsx b/pkgs/webview-ui/app/src/components/noiseThumbnail/index.tsx index 77c1c4a1c..66c122bea 100644 --- a/pkgs/webview-ui/app/src/components/noiseThumbnail/index.tsx +++ b/pkgs/webview-ui/app/src/components/noiseThumbnail/index.tsx @@ -100,13 +100,12 @@ interface RndThumbnailProps { height?: number; } export const RndThumbnail = (props: RndThumbnailProps) => { - const { name } = props; - const seed = Array.from(name).reduce( - (acc, char) => acc + char.charCodeAt(0), - 0, - ); // Seed from name - const imageSrc = generatePatternedImage(seed, props.width, props.height); - return {name}; + const seed = () => + Array.from(props.name).reduce((acc, char) => acc + char.charCodeAt(0), 0); // Seed from name + const imageSrc = () => + generatePatternedImage(seed(), props.width, props.height); + + return {props.name}; }; export const RndThumbnailShow = () => {