mirror of
https://github.com/bitwarden/desktop.git
synced 2024-11-28 12:35:40 +01:00
init menu after app ready
This commit is contained in:
parent
214d8f7ae8
commit
884eefd589
@ -8,7 +8,7 @@
|
||||
"build:main": "webpack --config webpack.main.js",
|
||||
"build:renderer": "webpack --config webpack.renderer.js",
|
||||
"build:renderer:watch": "webpack --config webpack.renderer.js --watch",
|
||||
"electron": "(npm run build:main | npm run build:renderer) & (electron ./build --dev --watch | npm run build:renderer:watch)"
|
||||
"electron": "(npm run build:main | npm run build:renderer) && (electron ./build --dev --watch | npm run build:renderer:watch)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bitwarden/jslib": "git+https://github.com/bitwarden/jslib.git",
|
||||
|
@ -19,10 +19,10 @@ const windowMain = new WindowMain(dev);
|
||||
const messagingMain = new MessagingMain(windowMain);
|
||||
const menuMain = new MenuMain(windowMain, i18nService);
|
||||
|
||||
windowMain.init();
|
||||
messagingMain.init();
|
||||
|
||||
i18nService.init().then(() => {
|
||||
windowMain.init().then(() => {
|
||||
messagingMain.init();
|
||||
return i18nService.init();
|
||||
}).then(() => {
|
||||
menuMain.init();
|
||||
}, (e: any) => {
|
||||
console.log(e);
|
||||
|
@ -329,7 +329,7 @@ export class MenuMain {
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
template[0].label = app.getName();
|
||||
(template[0].submenu as MenuItemConstructorOptions[]).concat([
|
||||
template[0].submenu = (template[0].submenu as MenuItemConstructorOptions[]).concat([
|
||||
{ type: 'separator' },
|
||||
{ role: 'about' },
|
||||
{ type: 'separator' },
|
||||
|
@ -7,12 +7,16 @@ export class WindowMain {
|
||||
|
||||
constructor(private dev: boolean) { }
|
||||
|
||||
init() {
|
||||
init(): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.on('ready', () => this.createWindow());
|
||||
app.on('ready', () => {
|
||||
this.createWindow();
|
||||
resolve();
|
||||
});
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', () => {
|
||||
@ -34,7 +38,9 @@ export class WindowMain {
|
||||
} catch (e) {
|
||||
// Catch Error
|
||||
// throw e;
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private createWindow() {
|
||||
|
Loading…
Reference in New Issue
Block a user