mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Merge pull request #14134 from atom/fb-mdt-dont-store-default-locations
Don't store default locations
This commit is contained in:
@@ -77,6 +77,21 @@ class StateStore {
|
||||
})
|
||||
}
|
||||
|
||||
delete (key) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.dbPromise.then((db) => {
|
||||
if (db == null) return resolve()
|
||||
|
||||
var request = db.transaction(['states'], 'readwrite')
|
||||
.objectStore('states')
|
||||
.delete(key)
|
||||
|
||||
request.onsuccess = resolve
|
||||
request.onerror = reject
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
clear () {
|
||||
return this.dbPromise.then((db) => {
|
||||
if (!db) return
|
||||
|
||||
@@ -301,7 +301,17 @@ module.exports = class Workspace extends Model {
|
||||
if (typeof item.getURI === 'function') {
|
||||
const uri = item.getURI()
|
||||
if (uri != null) {
|
||||
this.itemLocationStore.save(item.getURI(), paneContainer.getLocation())
|
||||
const location = paneContainer.getLocation()
|
||||
let defaultLocation
|
||||
if (typeof item.getDefaultLocation === 'function') {
|
||||
defaultLocation = item.getDefaultLocation()
|
||||
}
|
||||
defaultLocation = defaultLocation || 'center'
|
||||
if (location === defaultLocation) {
|
||||
this.itemLocationStore.delete(item.getURI())
|
||||
} else {
|
||||
this.itemLocationStore.save(item.getURI(), location)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user