Skip to content

Commit

Permalink
Merge pull request #634 from gbisaga/issues/626
Browse files Browse the repository at this point in the history
Fix type error and pass actual entered baud rate
  • Loading branch information
jurgelenas authored Jul 18, 2024
2 parents 874e0fe + dad638f commit 41df250
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2689,11 +2689,11 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"name": "Float",
"ofType": null
}
},
"defaultValue": "\"420000\"",
"defaultValue": "420000",
"isDeprecated": false,
"deprecationReason": null
},
Expand Down
2 changes: 1 addition & 1 deletion src/api/src/graphql/inputs/SerialConnectionConfigInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class SerialConnectionConfigInput {
@Field(() => String)
port: string;

@Field(() => String)
@Field(() => Number)
baudRate: number;

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/SerialConnectionForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const SerialConnectionForm: FunctionComponent<SerialConnectionFormProps> = (
}, [data, previousData]);

Check warning on line 123 in src/ui/components/SerialConnectionForm/index.tsx

View workflow job for this annotation

GitHub Actions / test (ubuntu-20.04)

React Hook useEffect has a missing dependency: 'currentValue'. Either include it or remove the dependency array

Check warning on line 123 in src/ui/components/SerialConnectionForm/index.tsx

View workflow job for this annotation

GitHub Actions / test (windows-2019)

React Hook useEffect has a missing dependency: 'currentValue'. Either include it or remove the dependency array

Check warning on line 123 in src/ui/components/SerialConnectionForm/index.tsx

View workflow job for this annotation

GitHub Actions / test (macos-latest)

React Hook useEffect has a missing dependency: 'currentValue'. Either include it or remove the dependency array
const onSubmit = () => {
if (currentValue !== null) {
onConnect(currentValue?.value, baudRate);
onConnect(currentValue?.value, currentBaud);
}
};
return (
Expand Down
2 changes: 1 addition & 1 deletion src/ui/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export type Release = {
};

export type SerialConnectionConfigInput = {
readonly baudRate?: Scalars['String']['input'];
readonly baudRate?: Scalars['Float']['input'];
readonly port?: Scalars['String']['input'];
};

Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/SerialMonitorView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const SerialMonitorView: FunctionComponent = () => {
variables: {
input: {
port: newSerialDevice,
baudRate: newBaudRate.toString(),
baudRate: newBaudRate,
},
},
})
Expand Down

0 comments on commit 41df250

Please sign in to comment.