@@ -159,7 +159,7 @@ const LeetCodeNotebookToolbar: React.FC<{ notebook: NotebookPanel }> = ({
159159 setWsRetries ( wsRetries + 1 ) ;
160160 } else {
161161 submitPromise ?. reject ( {
162- error : 'WebSocket connection failed after 10 retries.'
162+ error : '🔴 Error: WebSocket connection failed after 10 retries.'
163163 } ) ;
164164 }
165165 }
@@ -174,12 +174,11 @@ const LeetCodeNotebookToolbar: React.FC<{ notebook: NotebookPanel }> = ({
174174 Notification . promise ( submitPromise . promise , {
175175 pending : { message : '⏳ Pending...' , options : { autoClose : false } } ,
176176 success : {
177- message : ( result : any ) =>
178- `${ status2Emoji ( result . status_msg ) } Result: ${ result . status_msg } ` ,
177+ message : ( result : any ) => result . message ,
179178 options : { autoClose : 3000 }
180179 } ,
181180 error : {
182- message : ( result : any ) => `🔴 Error: ${ result . error } ` ,
181+ message : ( result : any ) => result . error ,
183182 options : { autoClose : 3000 }
184183 }
185184 } ) ;
@@ -190,7 +189,12 @@ const LeetCodeNotebookToolbar: React.FC<{ notebook: NotebookPanel }> = ({
190189 if ( result ?. state !== 'SUCCESS' ) {
191190 return ;
192191 }
193- submitPromise ?. resolve ( { status_msg : result . status_msg } ) ;
192+ const msg = `${ status2Emoji ( result . status_msg ) } Result: ${ result . status_msg } ` ;
193+ if ( result . status_msg === 'Accepted' ) {
194+ submitPromise ?. resolve ( { message : msg } ) ;
195+ } else {
196+ submitPromise ?. reject ( { error : msg } ) ;
197+ }
194198 const resultCellModel = getResultCell ( ) ;
195199 if ( resultCellModel ) {
196200 populateResultCell ( resultCellModel , result ) ;
0 commit comments