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