Skip to content

Commit 363e21b

Browse files
committed
fix(commandline): tags not showing active state correctly
1 parent e5f8cb3 commit 363e21b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

frontend/src/ts/commandline/commandline.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ let subgroupOverride: CommandsSubgroup | null = null;
4343
let isAnimating = false;
4444
let lastSingleListModeInputValue = "";
4545

46-
type CommandWithActiveState = Omit<Command, "active"> & { isActive: boolean };
46+
type CommandWithIsActive = Command & { isActive: boolean };
4747

4848
let lastState:
4949
| {
50-
list: CommandWithActiveState[];
50+
list: CommandWithIsActive[];
5151
usingSingleList: boolean;
5252
}
5353
| undefined;
@@ -427,8 +427,7 @@ async function showCommands(): Promise<void> {
427427
}
428428
}
429429
}
430-
const { active: _active, ...restOfCommand } = command;
431-
return { ...restOfCommand, isActive } as CommandWithActiveState;
430+
return { ...command, isActive } as CommandWithIsActive;
432431
});
433432

434433
if (
@@ -461,7 +460,7 @@ async function showCommands(): Promise<void> {
461460
let display = command.display;
462461
if (usingSingleList) {
463462
display = (command.singleListDisplay ?? "") || command.display;
464-
if (command.configValue !== undefined) {
463+
if (command.configValue !== undefined || command.active !== undefined) {
465464
display = display.replace(
466465
`<i class="fas fa-fw fa-chevron-right chevronIcon"></i>`,
467466
`<i class="fas fa-fw fa-chevron-right chevronIcon"></i>` +
@@ -472,9 +471,10 @@ async function showCommands(): Promise<void> {
472471

473472
let finalIconHtml = iconHtml;
474473
if (
475-
!usingSingleList &&
476-
command.subgroup === undefined &&
477-
command.configValue !== undefined
474+
(!usingSingleList &&
475+
command.subgroup === undefined &&
476+
command.configValue !== undefined) ||
477+
(!usingSingleList && command.active !== undefined)
478478
) {
479479
finalIconHtml = configIconHtml;
480480
}

0 commit comments

Comments
 (0)