Skip to content

Commit 8d77d75

Browse files
authored
chore(ui): Clean up warnings (#536)
1 parent 718b343 commit 8d77d75

File tree

5 files changed

+28
-26
lines changed

5 files changed

+28
-26
lines changed

ui/src/components/Terminal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ function Terminal({
6161
dataChannel,
6262
type,
6363
}: {
64-
title: string;
65-
dataChannel: RTCDataChannel;
66-
type: AvailableTerminalTypes;
64+
readonly title: string;
65+
readonly dataChannel: RTCDataChannel;
66+
readonly type: AvailableTerminalTypes;
6767
}) {
6868
const enableTerminal = useUiStore(state => state.terminalType == type);
6969
const setTerminalType = useUiStore(state => state.setTerminalType);

ui/src/components/popovers/PasteModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default function PasteModal() {
131131
}}
132132
>
133133
<div>
134-
<div className="w-full" onKeyUp={e => e.stopPropagation()}>
134+
<div className="w-full" onKeyUp={e => e.stopPropagation()} onKeyDown={e => e.stopPropagation()}>
135135
<TextAreaWithLabel
136136
ref={TextAreaRef}
137137
label="Paste from host"

ui/src/routes/devices.$id.settings.tsx

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -269,22 +269,17 @@ export default function SettingsRoute() {
269269
);
270270
}
271271

272-
export function SettingsItem({
273-
title,
274-
description,
275-
children,
276-
className,
277-
loading,
278-
badge,
279-
}: {
280-
title: string;
281-
description: string | React.ReactNode;
282-
children?: React.ReactNode;
283-
className?: string;
284-
name?: string;
285-
loading?: boolean;
286-
badge?: string;
287-
}) {
272+
interface SettingsItemProps {
273+
readonly title: string;
274+
readonly description: string | React.ReactNode;
275+
readonly badge?: string;
276+
readonly className?: string;
277+
readonly loading?: boolean;
278+
readonly children?: React.ReactNode;
279+
}
280+
export function SettingsItem(props: SettingsItemProps) {
281+
const { title, description, badge, children, className, loading } = props;
282+
288283
return (
289284
<label
290285
className={cx(

ui/src/routes/devices.$id.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,10 @@ export default function KvmIdRoute() {
715715
useEffect(() => {
716716
if (!peerConnection) return;
717717
if (!kvmTerminal) {
718-
// console.log('Creating data channel "terminal"');
719718
setKvmTerminal(peerConnection.createDataChannel("terminal"));
720719
}
721720

722721
if (!serialConsole) {
723-
// console.log('Creating data channel "serial"');
724722
setSerialConsole(peerConnection.createDataChannel("serial"));
725723
}
726724
}, [kvmTerminal, peerConnection, serialConsole]);
@@ -755,10 +753,10 @@ export default function KvmIdRoute() {
755753

756754
const ConnectionStatusElement = useMemo(() => {
757755
const hasConnectionFailed =
758-
connectionFailed || ["failed", "closed"].includes(peerConnectionState || "");
756+
connectionFailed || ["failed", "closed"].includes(peerConnectionState ?? "");
759757

760758
const isPeerConnectionLoading =
761-
["connecting", "new"].includes(peerConnectionState || "") ||
759+
["connecting", "new"].includes(peerConnectionState ?? "") ||
762760
peerConnection === null;
763761

764762
const isDisconnected = peerConnectionState === "disconnected";
@@ -826,7 +824,7 @@ export default function KvmIdRoute() {
826824
isLoggedIn={authMode === "password" || !!user}
827825
userEmail={user?.email}
828826
picture={user?.picture}
829-
kvmName={deviceName || "JetKVM Device"}
827+
kvmName={deviceName ?? "JetKVM Device"}
830828
/>
831829

832830
<div className="relative flex h-full w-full overflow-hidden">
@@ -846,6 +844,9 @@ export default function KvmIdRoute() {
846844

847845
<div
848846
className="z-50"
847+
onClick={e => e.stopPropagation()}
848+
onMouseUp={e => e.stopPropagation()}
849+
onMouseDown={e => e.stopPropagation()}
849850
onKeyUp={e => e.stopPropagation()}
850851
onKeyDown={e => {
851852
e.stopPropagation();
@@ -869,7 +870,12 @@ export default function KvmIdRoute() {
869870
);
870871
}
871872

872-
function SidebarContainer({ sidebarView }: { sidebarView: string | null }) {
873+
interface SidebarContainerProps {
874+
readonly sidebarView: string | null;
875+
}
876+
877+
function SidebarContainer(props: SidebarContainerProps) {
878+
const { sidebarView }= props;
873879
return (
874880
<div
875881
className={cx(

ui/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"compilerOptions": {
33
"target": "ES2020",
44
"useDefineForClassFields": true,
5+
"forceConsistentCasingInFileNames": true,
56
"lib": ["ES2021", "DOM", "DOM.Iterable"],
67
"module": "ESNext",
78
"skipLibCheck": true,

0 commit comments

Comments
 (0)