Skip to content

Commit

Permalink
fix: Proper type for device info RPC response.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Jun 29, 2024
1 parent 1ce4891 commit 7f02898
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@ import { call_rpc } from "@zmkfirmware/zmk-studio-ts-client";
import { useConnectedDeviceData } from "./rpc/useConnectedDeviceData";
import { useSub } from "./usePubSub";
import { ConnectionContext } from "./rpc/ConnectionContext";
import { GetDeviceInfoResponse } from "@zmkfirmware/zmk-studio-ts-client/core";

export interface AppHeaderProps {
connectedDeviceLabel?: string;
}

export const AppHeader = ({ connectedDeviceLabel }: AppHeaderProps) => {
export const AppHeader = ({}: AppHeaderProps) => {
const [unsaved, setUnsaved] = useConnectedDeviceData<boolean>(
{ keymap: { checkUnsavedChanges: true } },
(r) => r.keymap?.checkUnsavedChanges
);

const [deviceInfo, _setDeviceInfo] = useConnectedDeviceData<boolean>(
{ core: { getDeviceInfo: true } },
(r) => r.core?.getDeviceInfo
);
const [deviceInfo, _setDeviceInfo] =
useConnectedDeviceData<GetDeviceInfoResponse>(
{ core: { getDeviceInfo: true } },
(r) => r.core?.getDeviceInfo
);
const conn = useContext(ConnectionContext);

useSub("rpc_notification.keymap.unsavedChangesStatusChanged", (unsaved) =>
Expand Down

0 comments on commit 7f02898

Please sign in to comment.