Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Commit

Permalink
Fix crash when launcher not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
doZennn committed Sep 10, 2019
1 parent 9120814 commit 1a95948
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions src/js/Import.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,31 +232,33 @@ class Import extends React.Component {
noLaunchers
) : (
Object.keys(games).map((platform, i) => {
if (!this.platforms[i].error) {
return (
<div key={i}>
<h5 style={{float: 'left', ...this.context.theme.typographyStyles.subTitle}}>{this.platforms[i].name}</h5>
<ImportAllButton
games={games[platform]}
grids={grids[i]}
platform={this.platforms[i]}
onButtonClick={this.addGames}
/>
<ImportList
games={games[platform]}
platform={this.platforms[i]}
grids={grids[i]}
onImportClick={this.addGame}
/>
</div>
);
} else {
return (
<div key={i}>
<h5 style={this.context.theme.typographyStyles.subTitle}>{this.platforms[i].name}</h5>
<p>Error importing: {this.platforms[i].errorReason.message}</p>
</div>
);
if (this.platforms[i].installed) {
if (!this.platforms[i].error) {
return (
<div key={i}>
<h5 style={{float: 'left', ...this.context.theme.typographyStyles.subTitle}}>{this.platforms[i].name}</h5>
<ImportAllButton
games={games[platform]}
grids={grids[i]}
platform={this.platforms[i]}
onButtonClick={this.addGames}
/>
<ImportList
games={games[platform]}
platform={this.platforms[i]}
grids={grids[i]}
onImportClick={this.addGame}
/>
</div>
);
} else {
return (
<div key={i}>
<h5 style={this.context.theme.typographyStyles.subTitle}>{this.platforms[i].name}</h5>
<p>Error importing: {this.platforms[i].errorReason.message}</p>
</div>
);
}
}
})
)}
Expand Down

0 comments on commit 1a95948

Please sign in to comment.