Skip to content

Commit

Permalink
remove heavy debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
CGastrell authored and dhasilva committed Dec 23, 2024
1 parent 599c6a1 commit ed9f01e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export default function AiImageModal( {
}
}, [ imageStyles, initialStyle ] );

debug( 'images', images );
return (
<>
{ open && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useEffect, useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { Icon, chevronLeft, chevronRight } from '@wordpress/icons';
import clsx from 'clsx';
import debugFactory from 'debug';
/**
* Internal dependencies
*/
Expand Down Expand Up @@ -51,7 +50,6 @@ function BlankImage( { children, isDotted = false, contentClassName = '' } ) {
);
}

const debug = debugFactory( 'jetpack-ai:carrousel' );
export default function Carrousel( {
images,
current,
Expand Down Expand Up @@ -91,7 +89,7 @@ export default function Carrousel( {
const total = images?.filter?.(
item => item?.generating || Object.hasOwn( item, 'image' ) || Object.hasOwn( item, 'libraryId' )
)?.length;
debug( 'total', total );

const actual = current === 0 && total === 0 ? 0 : current + 1;

useEffect( () => {
Expand All @@ -114,7 +112,6 @@ export default function Carrousel( {
setImageFeedbackDisabled( false );
}, [ current, images ] );

debug( 'current', current, images[ current ] );
return (
<div className="ai-assistant-image__carrousel">
<div className="ai-assistant-image__carrousel-images">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ export default function FeaturedImage( {
const toggleEditorPanelOpened =
toggleEditorPanelOpenedFromEditor ?? toggleEditorPanelOpenedFromEditPost;

debug( 'postFeaturedMediaId', postFeaturedMediaId );

const {
pointer,
current,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useDispatch, useSelect } from '@wordpress/data';
import { useCallback, useEffect, useRef, useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { cleanForSlug } from '@wordpress/url';
import debugFactory from 'debug';
/**
* Internal dependencies
*/
Expand All @@ -38,8 +37,6 @@ export type ImageResponse = {
revisedPrompt?: string;
};

const debug = debugFactory( 'jetpack-ai:use-ai-image' );

export default function useAiImage( {
feature,
type,
Expand All @@ -53,7 +50,6 @@ export default function useAiImage( {
autoStart?: boolean;
previousMediaId?: number;
} ) {
debug( 'previousImages', previousMediaId );
const { generateImageWithParameters } = useImageGenerator();
const { increaseRequestsCount, featuresControl } = useAiFeature();
const { saveToMediaLibrary } = useSaveToMediaLibrary();
Expand All @@ -66,7 +62,7 @@ export default function useAiImage( {
// TODO: should current be any relevant here? It's just modal/carrousel logic after all
const [ current, setCurrent ] = useState( 0 );
const [ images, setImages ] = useState< CarrouselImages >( [ { generating: autoStart } ] );
debug( 'images', images );

// map feature-to-control prop, if this goes over 2 options, make a hook for it
const featureControl = feature === FEATURED_IMAGE_FEATURE_NAME ? 'featured-image' : 'image';
const imageFeatureControl = featuresControl?.[ featureControl ] as ImageFeatureControl;
Expand Down Expand Up @@ -291,7 +287,7 @@ export default function useAiImage( {
},
[ imageStyles ]
);
debug( pointer.current, current );

return {
current,
setCurrent,
Expand Down

0 comments on commit ed9f01e

Please sign in to comment.