Browse Source

New DB storage

master
Loëck Vézien 7 years ago
parent
commit
8815f86dd7
No known key found for this signature in database GPG Key ID: CBCDCE384E853AC4
  1. 26
      src/helpers/db.js
  2. 2
      src/middlewares/db.js

26
src/helpers/db.js

@ -1,7 +1,25 @@
import Store from 'electron-store'
const store = new Store({
// encryptionKey: 'toto',
})
export default {
accounts: () => {
const db = new Store({
name: 'accounts',
default: {
accounts: [],
},
})
export default store
return {
get: db.get('accounts'),
set: accounts => db.get('accounts', accounts),
}
},
settings: () => {
const db = new Store({
name: 'settings',
default: {},
})
return db
},
}

2
src/middlewares/db.js

@ -13,5 +13,5 @@ export default store => next => action => {
const { accounts } = getState()
db.set('accounts', accounts.accounts)
db.accounts.set(accounts.accounts)
}

Loading…
Cancel
Save