From 1f42140448e09e122d3ea6bb5b67b9d6d7ce15dd Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 23 Apr 2020 13:15:40 +0100 Subject: [PATCH] fix(BREAKING): ipfs daemon flags (#1437) License: MIT Signed-off-by: Henrique Dias --- src/common/store.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/common/store.js b/src/common/store.js index a5b7ffb6f..4eef4cb7c 100644 --- a/src/common/store.js +++ b/src/common/store.js @@ -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()) }