Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kastl <daniel@georepublic.de>
  • Loading branch information
dkastl committed Oct 3, 2024
1 parent 3614273 commit 5dcd2a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/formHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { generateChannelId } from "./utils";

/**
* Get the values from the form using FormData API.
*/
Expand All @@ -10,7 +8,7 @@ export function getFormValues() {
throw new Error('Form element not found.');
}

const formData = new FormData(form); // Pass the form to FormData
const formData = new FormData(form);

// Extract form values and ensure the correct types
const channelName = formData.get('channelName') as string;
Expand All @@ -22,7 +20,8 @@ export function getFormValues() {
const modemPreset = Number(formData.get('modemPreset'));
const hopLimit = Number(formData.get('hopLimit'));

const uplinkEnabled = formData.get('uplinkEnabled') === 'on'; // Checkbox returns 'on' or undefined
// Checkboxes return 'on' or undefined
const uplinkEnabled = formData.get('uplinkEnabled') === 'on';
const downlinkEnabled = formData.get('downlinkEnabled') === 'on';
const positionPrecision = Number(formData.get('positionPrecision'));
const isClientMuted = formData.get('isClientMuted') === 'on';
Expand Down
2 changes: 0 additions & 2 deletions src/protobufBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ export function buildProtobuf({
configOkToMqtt: configOkToMqtt || false,
});

console.log(configOkToMqtt, ignoreMqtt);

const moduleSettings = new Protobuf.Channel.ModuleSettings({
positionPrecision: positionPrecision || 0,
isClientMuted: isClientMuted || false,
Expand Down

0 comments on commit 5dcd2a9

Please sign in to comment.