Skip to content

Commit

Permalink
inline a function that no longer did what it was called
Browse files Browse the repository at this point in the history
  • Loading branch information
obra committed Feb 6, 2024
1 parent ed148ed commit ef0b557
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/renderer/screens/KeyboardSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,6 @@ const KeyboardSelect = (props) => {
const { t } = useTranslation();
const focus = new Focus();

const scanDevices = async () => {
setLoading(true);
console.log("scanDevices");
const focus = await connectToSerialport();
if (focus) {
props.onConnect(focus);
console.log("Got a device - here's its focus object: ", focus);
} else {
console.log("looks like the user aborted");
setOpening(false);
}
};

const onDisconnect = () => {
props.onDisconnect();
};
Expand All @@ -67,7 +54,17 @@ const KeyboardSelect = (props) => {
setOpening(true);

try {
await scanDevices();
setLoading(true);
console.log("in connectToKeyboard");
const focus = await connectToSerialport();
if (focus) {
console.log("Calling props.onConnect with the focus object");
props.onConnect(focus);
console.log("Got a device - here's its focus object: ", focus);
} else {
console.log("looks like the user aborted");
setOpening(false);
}
} catch (err) {
console.error("error while trying to connect", {
error: err,
Expand Down

0 comments on commit ef0b557

Please sign in to comment.