AlexTorresDev / custom-electron-titlebar

Custom electon title bar inpire on VS Code title bar
MIT License
870 stars 149 forks source link

fix `updateMenu(null)` not working #204

Closed Araxeus closed 1 year ago

Araxeus commented 1 year ago

The problem

We want to dynamically change if the menu is displayed or not, there was an option added in v4.1.0 which did exactly that:

titlebar.updateMenu(null);

A refactor in a later version broke that functionality.

The solution

In updateMenu, after disposing of the old bar, if there isn't a new bar specified, exit the function

the fix is one line, the other changes are typescript errors that prevented me from compiling for testing


We actually depend on this feature over at https://github.com/th-ch/youtube-music - can you please merge and release a hotfix? @AlexTorresDev

Araxeus commented 1 year ago

Woah that was merged super fast, thanks alex!