fix: set default menu in will-finish-launching event (#23214)

This commit is contained in:
Cheng Zhao 2020-04-24 02:51:31 +09:00 committed by GitHub
parent 69ccf94d45
commit cb6a1e2c5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -1,7 +1,10 @@
const { app, BrowserWindow } = require('electron');
let win;
app.whenReady().then(function () {
// This test uses "app.once('ready')" while the |test-menu-null| test uses
// "app.whenReady()", the 2 APIs have slight difference on timing to cover
// more cases.
app.once('ready', function () {
win = new BrowserWindow({});
win.setMenuBarVisibility(false);