Skip to content

Commit

Permalink
Merge pull request #115 from NSchrading/fix-enum-values
Browse files Browse the repository at this point in the history
Filter out non-integer values from the species enum
  • Loading branch information
MaxBittker authored Mar 5, 2021
2 parents 7070dba + 5c59cae commit 2e03001
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/components/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class Index extends React.Component {
>
Wind
</button>
{Object.keys(Species).map((n) =>
{Object.keys(Species).filter(x => !Number.isInteger(Number.parseInt(x))).map((n) =>
ElementButton(n, selectedElement, (id) =>
this.setState({ selectedElement: id })
)
Expand Down
2 changes: 1 addition & 1 deletion js/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ let snapshot = (universe) => {
let pallette = () => {
let canvas = document.createElement("canvas");

let species = Object.values(Species);
let species = Object.values(Species).filter(x => Number.isInteger(x));;
let range = Math.max(...species) + 1;
let universe = Universe.new(range, 1);
canvas.width = range;
Expand Down

0 comments on commit 2e03001

Please sign in to comment.