Skip to content

Commit

Permalink
fix(BREAKING): ipfs daemon flags (#1437)
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Henrique Dias <[email protected]>
  • Loading branch information
hacdias authored Apr 23, 2020
1 parent 47e6306 commit 1f42140
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/common/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@ const Store = require('electron-store')

const store = new Store()

if (store.get('version') !== 5) {
const defaultFlags = [
'--migrate',
'--enable-gc',
'--routing', 'dhtclient'
]

if (store.get('version', 0) < 5) {
store.clear()

// default config
store.set('ipfsConfig', {
type: 'go',
path: '',
flags: ['--migrate=true', '--routing=dhtclient', '--enable-gc=true'],
flags: defaultFlags,
keysize: 2048
})

store.set('version', 5)
}

const flags = store.get('ipfsConfig.flags', [])

if (flags.includes('--migrate=true') || flags.includes('--enable-gc=true')) {
store.set('ipfsConfig.flags', defaultFlags)
}

if (!store.get('language')) {
store.set('language', (electron.app || electron.remote.app).getLocale())
}
Expand Down

0 comments on commit 1f42140

Please sign in to comment.