refactor: replace .indexOf() with .includes() (#39195)

This commit is contained in:
Milan Burda 2023-07-24 12:32:54 +02:00 committed by GitHub
parent 9cd5de7588
commit 2c52eb7e1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View file

@ -82,7 +82,7 @@ Menu.prototype.popup = function (options = {}) {
// find which window to use
const wins = BaseWindow.getAllWindows();
if (!wins || wins.indexOf(window as any) === -1) {
if (!wins || !wins.includes(window as any)) {
window = BaseWindow.getFocusedWindow() as any;
if (!window && wins && wins.length > 0) {
window = wins[0] as any;