Skip to content

Commit

Permalink
rename var so it makes a bit more sense of what it is
Browse files Browse the repository at this point in the history
  • Loading branch information
CGastrell committed Dec 19, 2024
1 parent 6907d27 commit ebb8be5
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ebb8be5

Please sign in to comment.