Fix ordering issues when with_menu(None) is called before setting the window builder (#2903)

This commit is contained in:
Evan Almloff authored and GitHub committed 2024-08-29 15:51:31 -05:00
1 parent 4676171861
commit aa0ea444cf
2 files changed
+26 -13

No files matched your search

+3 -2
View File
@@ -317,10 +317,11 @@ impl WebviewInstance {
let webview = webview.build().unwrap();
let menu = if cfg!(not(any(target_os = "android", target_os = "ios"))) {
if let Some(menu) = &cfg.menu {
let menu_option = cfg.menu.into();
if let Some(menu) = &menu_option {
crate::menubar::init_menu_bar(menu, &window);
}
cfg.menu
menu_option
} else {
None
};