From 2b4e42650c506a30fa0d526f5dcb1ab71744a032 Mon Sep 17 00:00:00 2001 From: jeffsmale90 <6363749+jeffsmale90@users.noreply.github.com> Date: Wed, 25 Jan 2023 09:31:51 +1300 Subject: [PATCH] Only use the last selected flavor if it is a valid flavor (#5212) --- src/renderer/screens/startup/HomeScreen.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/renderer/screens/startup/HomeScreen.js b/src/renderer/screens/startup/HomeScreen.js index 0df7c9053..25d141d6c 100644 --- a/src/renderer/screens/startup/HomeScreen.js +++ b/src/renderer/screens/startup/HomeScreen.js @@ -29,7 +29,13 @@ import ReactTooltip from "react-tooltip"; class HomeScreen extends Component { constructor(props) { super(props); - this.state = {flavor: this.props.config.settings.global.last_flavor || "ethereum"}; + const lastFlavor = this.props.config.settings.global.last_flavor; + const flavor = + lastFlavor === "ethereum" || lastFlavor === "filecoin" + ? lastFlavor + : "ethereum"; + + this.state = { flavor }; this.handleFlavorChange = this.handleFlavorChange.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this); @@ -38,6 +44,7 @@ class HomeScreen extends Component { selectWorkspace(workspace) { this.props.dispatch(openWorkspace(workspace.name, workspace.flavor)); } + handleEditWorkspaceSettings(workspace, e) { const workspaceName = workspace.name; const workspaceFlavor = workspace.flavor;