File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
app/(dashboard)/components Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ export default function AdCustomizer() {
123123
124124 const [ finalImageUrl , setFinalImageUrl ] = useState < string | null > ( null ) ;
125125
126+ // console.log("Ad Data:", adData);
127+ // console.log("Inpaint Data:", inpaintData);
128+
126129 useEffect ( ( ) => {
127130 if ( inpaintData ?. data ?. image_url ) {
128131 setFinalImageUrl ( inpaintData . data . image_url ) ;
Original file line number Diff line number Diff line change @@ -80,14 +80,20 @@ export function useGenerateAdImage() {
8080 queryFn : async ( ) : Promise < TaskStatusResponse > => {
8181 if ( ! taskId ) throw new Error ( "No task ID" ) ;
8282 const response = await getRequest ( `/image/task/${ taskId } ` ) ;
83+ // console.log("Image generation status:", response);
8384
8485 if ( response . status_code === 200 && response . data . status === "pending" ) {
8586 setProgress ( ( prev ) => Math . min ( prev + 30 , 90 ) ) ;
86- } else if ( response . status_code === 201 ) {
87+ } else if (
88+ response . status_code === 201 ||
89+ response . data . status !== "pending"
90+ ) {
91+ // console.log("Image generation completed:", response);
8792 setCompletedData ( response ) ;
8893 setProgress ( 100 ) ;
8994 }
90-
95+ // console.log("Image generation progress:", response.data.status);
96+
9197 return response ;
9298 } ,
9399 enabled : ! ! taskId && ! completedData ,
@@ -105,8 +111,8 @@ export function useGenerateAdImage() {
105111 ...data ,
106112 data : {
107113 ...data . data ,
108- image_id : taskId ,
109- product_name : data . data . product_name ,
114+ image_id : taskId ,
115+ product_name : data . data . product_name ,
110116 } ,
111117 } ) ,
112118 } ) ;
You can’t perform that action at this time.
0 commit comments