mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Check whether state store is connected when prompting to save files
This commit is contained in:
@@ -10,10 +10,12 @@ class StateStore {
|
||||
db.createObjectStore('states')
|
||||
}
|
||||
dbOpenRequest.onsuccess = () => {
|
||||
this.isConnected = true
|
||||
resolve(dbOpenRequest.result)
|
||||
}
|
||||
dbOpenRequest.onerror = (error) => {
|
||||
console.error('Could not connect to indexedDB', error)
|
||||
this.isConnected = false
|
||||
resolve(null)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -892,7 +892,7 @@ class TextEditor extends Model
|
||||
# Determine whether the user should be prompted to save before closing
|
||||
# this editor.
|
||||
shouldPromptToSave: ({windowCloseRequested, projectHasPaths}={}) ->
|
||||
if windowCloseRequested and projectHasPaths
|
||||
if windowCloseRequested and projectHasPaths and atom.stateStore.isConnected
|
||||
false
|
||||
else
|
||||
@isModified() and not @buffer.hasMultipleEditors()
|
||||
|
||||
Reference in New Issue
Block a user