Skip to content

Commit b3b91f5

Browse files
authored
Merge pull request #139 from arduino/bugfix/prompt-to-save-before-quit
Prompting to save before quit also for new files
2 parents b05f397 + befd117 commit b3b91f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/arduino/store.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ async function store(state, emitter) {
369369
emitter.on('close-tab', (id) => {
370370
log('close-tab', id)
371371
const currentTab = state.openFiles.find(f => f.id === id)
372-
if (currentTab.hasChanges && currentTab.parentFolder !== null) {
372+
if (currentTab.hasChanges) {
373373
let response = confirm("Your file has unsaved changes. Are you sure you want to proceed?")
374374
if (!response) return false
375375
}
@@ -1324,7 +1324,7 @@ async function store(state, emitter) {
13241324
})
13251325

13261326
win.beforeClose(async () => {
1327-
const hasChanges = !!state.openFiles.find(f => f.parentFolder && f.hasChanges)
1327+
const hasChanges = !!state.openFiles.find(f => f.hasChanges)
13281328
if (hasChanges) {
13291329
const response = await confirm('You may have unsaved changes. Are you sure you want to proceed?', 'Yes', 'Cancel')
13301330
if (!response) return false

0 commit comments

Comments
 (0)