Commit d149ba3 1 parent a4ae125 commit d149ba3 Copy full SHA for d149ba3
File tree 1 file changed +15
-10
lines changed
1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change 156
156
const tab = this .tabs [index]
157
157
if (tab .filePath ) {
158
158
await this .save ({index, filePath: tab .filePath })
159
- } else {
160
- const filePath = remote .dialog .showSaveDialog (currentWindow, {
161
- filters: [
162
- {name: ' Markdown' , extensions: [' markdown' , ' md' ]}
163
- ]
164
- })
165
- if (filePath) await this .save ({index, filePath})
159
+ return true
160
+ }
161
+ const filePath = remote .dialog .showSaveDialog (currentWindow, {
162
+ filters: [
163
+ {name: ' Markdown' , extensions: [' markdown' , ' md' ]}
164
+ ]
165
+ })
166
+ if (filePath) {
167
+ await this .save ({index, filePath})
168
+ return true
166
169
}
167
170
} catch (err) {
168
171
handleError (err)
461
464
buttons: [' Save' , ' Cancel' , ' Don\' t Save' ]
462
465
})
463
466
if (clickedButton === 0 ) {
464
- await this .handleSave (index)
465
- this .$store .dispatch (' CLOSE_TAB' , index)
466
- return true
467
+ const saved = await this .handleSave (index)
468
+ if (saved) {
469
+ this .$store .dispatch (' CLOSE_TAB' , index)
470
+ return true
471
+ }
467
472
} else if (clickedButton === 2 ) {
468
473
this .$store .dispatch (' UPDATE_SAVE_STATUS' , {index, saved: true })
469
474
this .$store .dispatch (' CLOSE_TAB' , index)
You can’t perform that action at this time.
0 commit comments