From 5748c15e29fa0b4482af86edfc86dea0e2293930 Mon Sep 17 00:00:00 2001 From: Nishant Arora <1895906+whizzzkid@users.noreply.github.com> Date: Fri, 15 Sep 2023 02:32:13 -0600 Subject: [PATCH] feat(mv3): :twisted_rightwards_arrows: Adding migrations for embedded to external. Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com> --- add-on/src/lib/options.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/add-on/src/lib/options.js b/add-on/src/lib/options.js index 166b8191a..1bbbfca56 100644 --- a/add-on/src/lib/options.js +++ b/add-on/src/lib/options.js @@ -2,6 +2,7 @@ import isFQDN from 'is-fqdn' import { isIPv4, isIPv6 } from 'is-ip' +import { POSSIBLE_NODE_TYPES } from './state.js' /** * @type {Readonly} @@ -219,5 +220,14 @@ export async function migrateOptions (storage, debug) { } } + { + // -v3.0.0: migrate ipfsNodeType to 'external' (if missing) + const { ipfsNodeType } = await storage.get(['ipfsNodeType']) + if (!POSSIBLE_NODE_TYPES.includes(ipfsNodeType)) { + log('migrating ipfsNodeType to "external"') + await storage.set({ ipfsNodeType: 'external' }) + } + } + // TODO: refactor this, so migrations only run once (like https://github.com/sindresorhus/electron-store#migrations) }