From 4aeeab2bf944aa5ec104015d39bd7c473fc6f1bb Mon Sep 17 00:00:00 2001 From: Luna Seemann Date: Thu, 25 Jun 2026 00:18:31 +0200 Subject: [PATCH] fix(input/image-url): useless save on load (#90) --- components/inputs/image-url-input.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/inputs/image-url-input.tsx b/components/inputs/image-url-input.tsx index 4ee46e3..fcc77c0 100644 --- a/components/inputs/image-url-input.tsx +++ b/components/inputs/image-url-input.tsx @@ -45,7 +45,8 @@ export function InputImageUrl({ state, error, update, - save + save, + isDirty } = useInput({ endpoint, k, @@ -100,13 +101,12 @@ export function InputImageUrl({ const handleImageLoad = () => { setImageState(ImageState.Success); - // Image loaded successfully, now save + if (!isDirty) return; void save(); }; const handleImageError = () => { setImageState(ImageState.Errored); - // Don't save - image failed to load }; const isDisabled = state === InputState.Loading || disabled; -- 2.51.2