chore: linting

This commit is contained in:
Dan Ditomaso
2025-01-25 21:24:43 -05:00
parent d0ca24ae6f
commit f0dd426055
2 changed files with 31 additions and 30 deletions
@@ -4,9 +4,7 @@ import { Input } from "@components/UI/Input.tsx";
import { useDevice } from "@core/stores/deviceStore.ts"; import { useDevice } from "@core/stores/deviceStore.ts";
import type { Types } from "@meshtastic/js"; import type { Types } from "@meshtastic/js";
import { SendIcon } from "lucide-react"; import { SendIcon } from "lucide-react";
import { useCallback, useState, useMemo } from "react"; import { useCallback, useMemo, useState } from "react";
export interface MessageInputProps { export interface MessageInputProps {
to: Types.Destination; to: Types.Destination;
@@ -29,10 +27,11 @@ export const MessageInput = ({
const debouncedSetMessageDraft = useMemo( const debouncedSetMessageDraft = useMemo(
() => debounce(setMessageDraft, 300), () => debounce(setMessageDraft, 300),
[setMessageDraft] [setMessageDraft],
); );
const sendText = useCallback(async (message: string) => { const sendText = useCallback(
async (message: string) => {
await connection await connection
?.sendText(message, to, true, channel) ?.sendText(message, to, true, channel)
.then((id) => .then((id) =>
@@ -55,7 +54,9 @@ export const MessageInput = ({
e.error, e.error,
), ),
); );
}, [channel, connection, myNodeNum, setMessageState, to]); },
[channel, connection, myNodeNum, setMessageState, to],
);
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => { const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const newValue = e.target.value; const newValue = e.target.value;
+1 -1
View File
@@ -2,7 +2,7 @@ type Callback<Args extends unknown[]> = (...args: Args) => void;
export function debounce<Args extends unknown[]>( export function debounce<Args extends unknown[]>(
callback: Callback<Args>, callback: Callback<Args>,
wait: number wait: number,
): Callback<Args> { ): Callback<Args> {
let timeoutId: ReturnType<typeof setTimeout>; let timeoutId: ReturnType<typeof setTimeout>;