AlexTorresDev / custom-electron-titlebar

Custom electon title bar inpire on VS Code title bar
MIT License
862 stars 141 forks source link

updateMenu should be public #243

Open Christilut opened 11 months ago

Christilut commented 11 months ago

This method is marked private:

private updateMenu(menu?: Menu) { }

But if you update the menu with wth Menu.setApplicationMenu(menu) then the commandId's have changed but this package does not know about the new commandId's. The result is that clicking any menu item does not work since they refer to non-existing commandId's.

If I run titlebar.updateMenu(menu) after setApplicationMenu, the commandIds are also updated and clicks work as expected.

AlexTorresDev commented 8 months ago

You should use refreshMenu, an asynchronous method that refreshes the menu with what is in Menu.getApplicationMenu().