Skip to content

Commit 31bd32f

Browse files
committed
refactor: Simplify the layout set implementation.
1 parent c2cf65c commit 31bd32f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/keyboard/Keyboard.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,11 @@ export default function Keyboard() {
131131
const conn = useContext(ConnectionContext);
132132

133133
useEffect(() => {
134-
if (!conn) {
135-
return;
136-
}
137-
138134
async function performSetRequest() {
139135
if (!conn) { return; }
140136

141137
let resp = await call_rpc(conn, { keymap: { setActivePhysicalLayout: selectedPhysicalLayoutIndex }});
142-
138+
143139
if (!resp?.keymap?.setActivePhysicalLayout) {
144140
console.error("Failed to set the active physical layout to ", selectedPhysicalLayoutIndex);
145141
}

0 commit comments

Comments
 (0)