Clean up messy merge

feature/default_network_editable
frankiebee 8 years ago
parent 54e157020e
commit 4451593867
  1. 13
      library/controllers/index-db-controller.js

@ -50,18 +50,9 @@ module.exports = class IndexDbController extends EventEmitter {
get (key) { get (key) {
return this.requestObjectStore(key) return this.requestObjectStore(key)
.then((dataObject)=> { .then((dataObject)=> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const getRequest = dataObject.get(key) const getRequest = dataObject.get(key)
getRequest.onsuccess = (event) => { getRequest.onsuccess = (event) => resolve(event.currentTarget.result)
const serialized = event.currentTarget.result
try {
console.log('serialized:',serialized)
const state = serialized ? JSON.parse(serialized) : {}
resolve(state)
} catch (err) {
reject(err)
}
}
getRequest.onerror = (event) => reject(event) getRequest.onerror = (event) => reject(event)
}) })
}) })

Loading…
Cancel
Save