File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -205,8 +205,11 @@ let menuOpen = (item, focusedWindow) => {
205205 {
206206 properties : [ 'openFile' ] ,
207207 filters : fileExtensions
208- } , ( paths ) => {
209- if ( paths && paths . length > 0 ) { newWorksheet ( paths [ 0 ] ) }
208+ } ) . then ( ( result ) => {
209+ console . log ( result )
210+ if ( ! result . canceled && result . filePaths ) {
211+ result . filePaths . forEach ( path => { newWorksheet ( path ) } )
212+ }
210213 } )
211214}
212215
@@ -235,12 +238,13 @@ BrowserWindow.prototype.saveFile = function () {
235238
236239BrowserWindow . prototype . saveFileAs = function ( ) {
237240 let win = this
238- dialog . showSaveDialog ( win ,
239- { filters : fileExtensions } , ( path ) => {
240- if ( path ) {
241- win . setFilepath ( path )
242- win . saveFile ( )
243- }
241+ dialog . showSaveDialog ( win , {
242+ filters : fileExtensions
243+ } ) . then ( ( result ) => {
244+ if ( ! result . canceled && result . filePath ) {
245+ win . setFilepath ( result . filePath )
246+ win . saveFile ( )
247+ }
244248 } )
245249}
246250
You can’t perform that action at this time.
0 commit comments