Skip to content

Commit

Permalink
fix(CellEditor): add fuel handling.
Browse files Browse the repository at this point in the history
Also fix for an empty state for CoreEditor.
  • Loading branch information
aronhelser committed Jul 10, 2018
1 parent 7e3f148 commit 12c63b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/simput/CellEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ export default class CellEditor extends React.Component {
render() {
const { data } = this.props;
const viz = this.props.ui.domain;
const materialIds = viz.types.materials || [];
let materialIds = viz.types.fuels || [];
if (viz.types.materials)
materialIds = materialIds.concat(viz.types.materials);

const materialOptions = materialIds.map((id) => {
const color = toRGB(viz.colors[id]);
Expand All @@ -162,7 +164,7 @@ export default class CellEditor extends React.Component {
{
key: 'material',
dataKey: 'material',
label: 'Material',
label: 'Material / Fuel',
render: (matId, item) => {
const color = toRGB(viz.colors[matId]);
return (
Expand Down
3 changes: 2 additions & 1 deletion src/simput/CoreEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export default class CoreEditor extends React.Component {
render() {
const viz = this.props.ui.domain;
const vizData = Object.assign({ selected: this.props.viewData.id }, viz);
const types = viz.core.types[this.props.viewData.id] || [];
const types =
(viz.core.types && viz.core.types[this.props.viewData.id]) || [];
return (
<div className={style.container}>
<div className={style.switch}>
Expand Down

0 comments on commit 12c63b5

Please sign in to comment.