From ebb8be5f2b54f8347e8d715454ac20667586e72d Mon Sep 17 00:00:00 2001 From: Christian Gastrell Date: Thu, 19 Dec 2024 16:45:27 -0300 Subject: [PATCH] rename var so it makes a bit more sense of what it is --- .../components/ai-image/hooks/use-ai-image.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/hooks/use-ai-image.ts b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/hooks/use-ai-image.ts index 7898acb59ebc7..3933fedf8ec42 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/hooks/use-ai-image.ts +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/hooks/use-ai-image.ts @@ -82,23 +82,23 @@ export default function useAiImage( { }, [] ); // the selec/useEffect combo... - const currentFeaturedMedia = useSelect( + const loadedMedia = useSelect( ( select: ( store ) => CoreSelectors ) => select( 'core' )?.getMedia?.( previousMediaId ), [ previousMediaId ] ); useEffect( () => { - if ( currentFeaturedMedia ) { + if ( loadedMedia ) { updateImages( { - image: currentFeaturedMedia.source_url, - libraryId: currentFeaturedMedia.id, - libraryUrl: currentFeaturedMedia.source_url, + image: loadedMedia.source_url, + libraryId: loadedMedia.id, + libraryUrl: loadedMedia.source_url, generating: false, }, pointer.current ); } - }, [ currentFeaturedMedia, updateImages ] ); + }, [ loadedMedia, updateImages ] ); /* * Function to show a snackbar notice on the editor.