Skip to content

Commit

Permalink
fix: set remaining host connections with empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ert78gb committed Dec 22, 2024
1 parent 80399f6 commit 30ce184
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/uhk-web/src/app/store/effects/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export class DeviceEffects {
return this.router.navigate(['/update-firmware']);

if (state.userConfiguration.userConfiguration.hostConnections.length > HOST_CONNECTION_COUNT_MAX) {
return;
return this.router.navigate(['/host-connections']);
}

setTimeout(() => this.sendUserConfigToKeyboard(
Expand Down
5 changes: 5 additions & 0 deletions packages/uhk-web/src/app/store/reducers/user-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ export function reducer(
userConfiguration.hostConnections.push(hostConnection);
}

for (let i = userConfiguration.hostConnections.length; i < HOST_CONNECTION_COUNT_MAX; i++) {
userConfiguration.hostConnections.push(emptyHostConnection());
}

return {
...state,
userConfiguration,
Expand Down Expand Up @@ -252,6 +256,7 @@ export function reducer(
return {
...state,
newPairedDevicesAdding: false,
newPairedDevices: [],
};
}

Expand Down

0 comments on commit 30ce184

Please sign in to comment.