diff --git a/app/background/node/service.js b/app/background/node/service.js index 1019b5eb7..e5091a487 100644 --- a/app/background/node/service.js +++ b/app/background/node/service.js @@ -230,8 +230,10 @@ export class NodeService extends EventEmitter { await this.hsd.connect(); await this.hsd.startSync(); - if (!(await get('hsd-3.0.0-migrate'))) { - await put('hsd-3.0.0-migrate', true); + const migrateFlag = `${this.networkName}-hsd-3.0.0-migrate${spv ? '-spv' : ''}`; + + if (!(await get(migrateFlag))) { + await put(migrateFlag, true); } this.hsd.on('connect', async () => this.refreshNodeInfo()); diff --git a/app/components/SplashScreen/index.js b/app/components/SplashScreen/index.js index 06bef6c9e..ec02e31a1 100644 --- a/app/components/SplashScreen/index.js +++ b/app/components/SplashScreen/index.js @@ -4,10 +4,15 @@ import BobLogo from '../../assets/images/bob-logo-circle.svg'; import Spinner from '../../assets/images/brick-loader.svg'; import dbClient from "../../utils/dbClient"; import Alert from "../Alert"; +import {withRouter} from "react-router-dom"; +import {connect} from "react-redux"; -export default class SplashScreen extends Component { + +class SplashScreen extends Component { static propTypes = { error: Proptype.string, + network: Proptype.string, + spv: Proptype.bool, }; static defaultProps = { @@ -19,7 +24,9 @@ export default class SplashScreen extends Component { }; async componentWillMount() { - const hasMigrated300 = await dbClient.get('hsd-3.0.0-migrate'); + const {network, spv} = this.props; + const migrateFlag = `${network}-hsd-3.0.0-migrate${spv ? '-spv' : ''}`; + const hasMigrated300 = await dbClient.get(migrateFlag); this.setState({ hasMigrated300 }); } @@ -61,6 +68,15 @@ export default class SplashScreen extends Component { } } +export default withRouter( + connect( + (state) => ({ + network: state.node.network, + spv: state.node.spv, + }), + )(SplashScreen) +); + const wrapperStyle = { display: 'flex', flexFlow: 'column nowrap',