File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -64,21 +64,15 @@ export class SchemaDesignerWebviewController extends ReactWebviewPanelController
64
64
65
65
private registerReducers ( ) {
66
66
this . registerRequestHandler ( "exportToFile" , async ( payload ) => {
67
- // Get the current workspace folder
68
- let currentFolder : vscode . Uri ;
69
- if ( vscode . workspace . workspaceFolders ) {
70
- currentFolder = vscode . workspace . workspaceFolders [ 0 ] ?. uri ;
71
- }
72
- if ( ! currentFolder ) {
73
- currentFolder = vscode . Uri . file ( homedir ( ) ) ;
74
- }
67
+ // Determine the base folder for saving the file
68
+ const baseFolder =
69
+ vscode . workspace . workspaceFolders ?. [ 0 ] ?. uri ?? vscode . Uri . file ( homedir ( ) ) ;
75
70
71
+ // Prompt the user with a Save dialog
76
72
const outputPath = await vscode . window . showSaveDialog ( {
77
- filters : {
78
- [ payload . format ] : [ payload . format ] ,
79
- } ,
73
+ filters : { [ payload . format ] : [ payload . format ] } ,
80
74
defaultUri : await getUniqueFilePath (
81
- currentFolder ,
75
+ baseFolder ,
82
76
`schema-${ this . databaseName } ` ,
83
77
payload . format ,
84
78
) ,
You can’t perform that action at this time.
0 commit comments