File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
extension/src/plots/webview Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ export class WebviewMessages {
427427 | typeof EventName . VIEWS_PLOTS_EXPORT_PLOT_DATA_AS_TSV ,
428428 writeFile : ( filePath : string , plotId : string ) => void
429429 ) {
430- const file = await showSaveDialog ( ` data. ${ extName } ` , extName )
430+ const file = await this . showSaveDialog ( ' data' , extName )
431431
432432 if ( ! file ) {
433433 return
@@ -439,10 +439,7 @@ export class WebviewMessages {
439439 }
440440
441441 private async exportPlotAsSvg ( svg : string ) {
442- const file = await showSaveDialog (
443- join ( this . dvcRoot , 'visualization.svg' ) ,
444- 'svg'
445- )
442+ const file = await this . showSaveDialog ( 'visualization' , 'svg' )
446443 if ( ! file ) {
447444 return
448445 }
@@ -486,4 +483,9 @@ export class WebviewMessages {
486483 this . plots . savePlotDataAsTsv ( filePath , plotId )
487484 )
488485 }
486+
487+ private showSaveDialog ( filename : string , extName : string ) {
488+ const defaultPath = join ( this . dvcRoot , [ filename , extName ] . join ( '.' ) )
489+ return showSaveDialog ( defaultPath , extName )
490+ }
489491}
You can’t perform that action at this time.
0 commit comments