Skip to content

Commit 920bf36

Browse files
committed
Fixed group key highlights not updating when updating keybinds with a group highlighted
1 parent 7a6fc4f commit 920bf36

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/frontend/src/Upload.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,17 @@ const Upload = (props) => {
131131
const confirmKeybinds = (newKeybinds, key) => {
132132
newKeybinds = JSON.parse(JSON.stringify(newKeybinds));
133133
clearHighlightedKeys(Utils.bufferToHighlights(newKeybinds, ["keybind-row-setting-button", "keybind-row-hover-button"]),
134-
true);
134+
true);
135+
136+
// Ensure group highlighting gets refreshed. Kinda ugly having this here.
137+
if (highlightedGroup.current) {
138+
let rows = {}
139+
data.groups[highlightedGroup.current.textContent].forEach((UUID) => {
140+
rows[UUID] = ["menu-group-select-button"];
141+
});
142+
console.log(rows);
143+
clearHighlightedKeys(rows, true);
144+
}
135145

136146
// Update data and changed state variables
137147
let newHotkeys = {...data.hotkeys};
@@ -161,6 +171,18 @@ const Upload = (props) => {
161171

162172
setSettingKeybind(false);
163173
disableButtons(true);
174+
175+
// Ensure group highlighting gets refreshed. Kinda ugly having this here.
176+
if (highlightedGroup.current) {
177+
let rows = {};
178+
data.groups[highlightedGroup.current.textContent].forEach((UUID) => {
179+
rows[UUID] = ["menu-group-select-button"];
180+
});
181+
182+
console.log(rows);
183+
setHighlightedKeys(rows, false);
184+
}
185+
164186
return {};
165187
}
166188

0 commit comments

Comments
 (0)