TrayMenu: Fix duplicate menu items (#712)
This commit is contained in:
parent
a342ee0c63
commit
76f06b9f96
1 changed files with 2 additions and 1 deletions
|
|
@ -117,7 +117,8 @@ export function patchTrayMenu(): void {
|
|||
const originalBuildFromTemplate = Menu.buildFromTemplate;
|
||||
|
||||
Menu.buildFromTemplate = function (template: MenuItemConstructorOptions[]) {
|
||||
if (isTrayMenu(template)) {
|
||||
const alreadyPatched = template.some(item => item.label === "Equicord");
|
||||
if (isTrayMenu(template) && !alreadyPatched) {
|
||||
const insertIndex = findInsertIndex(template);
|
||||
const equicordItems = createEquicordMenuItems();
|
||||
template.splice(insertIndex, 0, ...equicordItems);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue