diff --git a/ui/arduino/store.js b/ui/arduino/store.js index 0074d6a..c600a0b 100644 --- a/ui/arduino/store.js +++ b/ui/arduino/store.js @@ -369,7 +369,7 @@ async function store(state, emitter) { emitter.on('close-tab', (id) => { log('close-tab', id) const currentTab = state.openFiles.find(f => f.id === id) - if (currentTab.hasChanges && currentTab.parentFolder !== null) { + if (currentTab.hasChanges) { let response = confirm("Your file has unsaved changes. Are you sure you want to proceed?") if (!response) return false } @@ -1324,7 +1324,7 @@ async function store(state, emitter) { }) win.beforeClose(async () => { - const hasChanges = !!state.openFiles.find(f => f.parentFolder && f.hasChanges) + const hasChanges = !!state.openFiles.find(f => f.hasChanges) if (hasChanges) { const response = await confirm('You may have unsaved changes. Are you sure you want to proceed?', 'Yes', 'Cancel') if (!response) return false