Simplify AI form overwrites
This commit is contained in:
parent
432294731e
commit
7fffe1063a
@ -53,13 +53,6 @@ export default function useAiImageQueries(
|
||||
const isLoadingTitle = _isLoadingTitle || isLoadingTitleSolo;
|
||||
const isLoadingCaption = _isLoadingCaption || isLoadingCaptionSolo;
|
||||
|
||||
const hasContent = Boolean(
|
||||
title ||
|
||||
caption ||
|
||||
tags ||
|
||||
semanticDescription
|
||||
);
|
||||
|
||||
const isLoading =
|
||||
isLoadingTitle ||
|
||||
isLoadingCaption ||
|
||||
@ -123,7 +116,6 @@ export default function useAiImageQueries(
|
||||
tags,
|
||||
semanticDescription,
|
||||
isReady,
|
||||
hasContent,
|
||||
isLoading,
|
||||
isLoadingTitle,
|
||||
isLoadingCaption,
|
||||
|
||||
@ -125,28 +125,28 @@ export default function PhotoForm({
|
||||
}, []);
|
||||
|
||||
useEffect(() =>
|
||||
setFormData(data => aiContent?.hasContent
|
||||
setFormData(data => aiContent?.title
|
||||
? { ...data, title: aiContent?.title }
|
||||
: data),
|
||||
[aiContent?.title, aiContent?.hasContent]);
|
||||
[aiContent?.title]);
|
||||
|
||||
useEffect(() =>
|
||||
setFormData(data => aiContent?.hasContent
|
||||
setFormData(data => aiContent?.caption
|
||||
? { ...data, caption: aiContent?.caption }
|
||||
: data),
|
||||
[aiContent?.caption, aiContent?.hasContent]);
|
||||
[aiContent?.caption]);
|
||||
|
||||
useEffect(() =>
|
||||
setFormData(data => aiContent?.hasContent
|
||||
setFormData(data => aiContent?.tags
|
||||
? { ...data, tags: aiContent?.tags }
|
||||
: data),
|
||||
[aiContent?.tags, aiContent?.hasContent]);
|
||||
[aiContent?.tags]);
|
||||
|
||||
useEffect(() =>
|
||||
setFormData(data => aiContent?.hasContent
|
||||
setFormData(data => aiContent?.semanticDescription
|
||||
? { ...data, semanticDescription: aiContent?.semanticDescription }
|
||||
: data),
|
||||
[aiContent?.semanticDescription, aiContent?.hasContent]);
|
||||
[aiContent?.semanticDescription]);
|
||||
|
||||
useEffect(() => {
|
||||
onTextContentChange?.(formHasTextContent(formData));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user