Skip to content

Commit

Permalink
fix(Tasks): Fixes an issue where you can't properly enter inventory f…
Browse files Browse the repository at this point in the history
…or the cargo task. Closes #3016
  • Loading branch information
alexanderson1993 committed Sep 4, 2020
1 parent d121141 commit 4d326d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions server/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const MainSchema = gql`
`;

// This resolver object can be extended if properties are added

// to the Query and Mutation types above.
const MainResolver = {};
export const typeDefs = Object.values(schema).reduce(
Expand Down
5 changes: 3 additions & 2 deletions src/components/views/Tasks/core/inputs/InventoryInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const InventoryInput = ({simulatorId, onChange, value}) => {
{({loading, data}) =>
loading ? null : (
<div>
{console.log(loading, data)}
<small>
Change the inventory item's name before adding another.
</small>
Expand All @@ -27,7 +28,7 @@ const InventoryInput = ({simulatorId, onChange, value}) => {
key={id}
style={{display: "flex", justifyContent: "space-between"}}
>
{data ? (
{data?.inventory?.length ? (
<select
value={id}
onChange={e => {
Expand All @@ -43,7 +44,7 @@ const InventoryInput = ({simulatorId, onChange, value}) => {
</select>
) : (
<input
defaultValue={id}
defaultValue={id === "undefined" ? "" : id}
onBlur={e => {
const {[id]: _, ...rest} = value;
onChange({...rest, [e.target.value]: count});
Expand Down

0 comments on commit 4d326d9

Please sign in to comment.