Issues (3)

app/lib/utils.js (1 issue)

1
/**
2
 * @file Utils
3
 */
4
/**
5
 * @module Utils
6
 */
7
8
import {menu} from '../main/index';
9
10
/**
11
 * Get menu item by label.
12
 * @param label {string} The label of the menu item to search for.
13
 * @returns {Electron.MenuItem} - The full menu item. Can change things like checked etc.
14
 */
15
export function getMenuItem (label) {
16
	for (let i = 0; i < menu.items.length; i++) {
17
		const menuItem = menu.items[i].submenu.items.find(item => item.label === label);
18
		if (menuItem) return menuItem
19
	}
0 ignored issues
show
There is no return statement in this branch, but you do return something in other branches. Did you maybe miss it? If you do not want to return anything, consider adding return undefined; explicitly.
Loading history...
20
}
21