File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,15 @@ export function useDiagram(username: string, repo: string) {
5151
5252 const generateDiagram = useCallback (
5353 async ( instructions = "" , apiKey ?: string , githubPat ?: string ) => {
54+ console . log ( "generateDiagram called" ) ;
5455 setState ( {
5556 status : "started" ,
5657 message : "Starting generation process..." ,
5758 } ) ;
59+ console . log ( "started state set" ) ;
5860
5961 try {
62+ console . log ( "fetching stream api" ) ;
6063 const baseUrl =
6164 process . env . NEXT_PUBLIC_API_DEV_URL ?? "https://api.gitdiagram.com" ; // keeping this here since its easier for streaming
6265 const response = await fetch ( `${ baseUrl } /generate/stream` , {
@@ -72,12 +75,13 @@ export function useDiagram(username: string, repo: string) {
7275 github_pat : githubPat ,
7376 } ) ,
7477 } ) ;
75-
78+ console . log ( "response" , response ) ;
7679 if ( ! response . ok ) {
7780 throw new Error ( "Failed to start streaming" ) ;
7881 }
79-
82+ console . log ( "accessing reader" ) ;
8083 const reader = response . body ?. getReader ( ) ;
84+ console . log ( "accessed reader" ) ;
8185 if ( ! reader ) {
8286 throw new Error ( "No reader available" ) ;
8387 }
You can’t perform that action at this time.
0 commit comments