electron flow type definitions

Summary: Adding a flowtype library definition for electron 3 and fixing related type errors

Reviewed By: passy

Differential Revision: D9124758

fbshipit-source-id: e09cb5b05ba952e7f95f68f9043edc586f81ae83
This commit is contained in:
Daniel Büchele
2018-08-02 03:41:53 -07:00
committed by Facebook Github Bot
parent 69eaedcbb0
commit 75dfbf51f8
9 changed files with 3767 additions and 75 deletions

View File

@@ -97,10 +97,13 @@ export function setupMenuBar() {
const menu = applicationMenu.items.find(
menuItem => menuItem.label === topLevelMenu,
);
const menuItem = menu.submenu.items.find(
menuItem => menuItem.label === label,
);
menuItems.set(action, menuItem);
if (menu) {
// $FlowFixMe submenu is missing in electron API spec
const menuItem = menu.submenu.items.find(
menuItem => menuItem.label === label,
);
menuItems.set(action, menuItem);
}
}
});