@@ -20,7 +20,6 @@ import { FileService } from './file-service';
2020export class JsonConfigEditor {
2121 private _tempFilePath : string = '' ;
2222 private isEditing : boolean = false ;
23- private isAwaitingUserSubmit : boolean = false ;
2423 private availableConfigurations : CustomizationConfigObject [ ] = [ ] ;
2524 private userClickedSubmit : boolean = false ;
2625 private trackedEditor ?: vscode . TextEditor ;
@@ -51,8 +50,6 @@ export class JsonConfigEditor {
5150 throw Error (
5251 'a config editing session is already active - Please close the active editor and try again.'
5352 ) ;
54- if ( this . isAwaitingUserSubmit )
55- throw Error ( 'awaiting prompt response - Please chose to if you want to submit then try again.' ) ;
5653
5754 this . availableConfigurations = configs ;
5855 const selectedConfig = await this . promptUserSchemaSelection ( configs ) ;
@@ -276,31 +273,22 @@ export class JsonConfigEditor {
276273
277274 try {
278275 this . isEditing = false ;
279- this . isAwaitingUserSubmit = true ;
280276 // Write content to temp file for validation
281277 if ( fs . existsSync ( this . tempFilePath ) ) {
282278 fs . writeFileSync ( this . tempFilePath , document . getText ( ) , 'utf8' ) ;
283279 } else {
284280 throw new Error ( 'Temporary file not found' ) ;
285281 }
286282
283+ if ( ! this . userClickedSubmit ) {
284+ return ;
285+ }
286+
287287 const validation = await this . schemaService . validateJsonFile ( this . tempFileUri , schema ) ;
288288
289289 if ( validation . isValid && validation . content ) {
290- const submit = this . userClickedSubmit
291- ? 'Yes'
292- : await vscode . window . showInformationMessage (
293- 'Do you want to submit this configuration?' ,
294- 'Yes' ,
295- 'No'
296- ) ;
297-
298- if ( submit === 'Yes' ) {
299- vscode . window . showInformationMessage ( 'Configuration submitted successfully' ) ;
300- return validation . content ;
301- }
302-
303- return undefined ; // User chose not to submit
290+ vscode . window . showInformationMessage ( 'Configuration submitted successfully' ) ;
291+ return validation . content ;
304292 } else if ( validation . errors ) {
305293 this . displayValidationErrorDialogue (
306294 `Your configuration was not submitted because it had errors` ,
@@ -321,7 +309,6 @@ export class JsonConfigEditor {
321309 private resetState = ( ) => {
322310 this . fileService . cleanupTempFile ( this . tempFilePath ) ;
323311 this . userClickedSubmit = false ;
324- this . isAwaitingUserSubmit = false ;
325312 this . isEditing = false ;
326313 this . trackedEditor = undefined ;
327314 this . tempFilePath = '' ;
0 commit comments