Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Only use the last selected flavor if it is a valid flavor (#5212)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsmale90 authored Jan 24, 2023
1 parent a51e533 commit 2b4e426
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/renderer/screens/startup/HomeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 2b4e426

Please sign in to comment.