mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-21 12:33:34 +02:00
fix(#1521): fixed issue related to recent menu being disabled
This commit is contained in:
parent
8287126deb
commit
eab50f01d7
@ -5,6 +5,7 @@ const { BrowserWindow, app, Menu, ipcMain } = require('electron');
|
|||||||
const { setContentSecurityPolicy } = require('electron-util');
|
const { setContentSecurityPolicy } = require('electron-util');
|
||||||
|
|
||||||
const menuTemplate = require('./app/menu-template');
|
const menuTemplate = require('./app/menu-template');
|
||||||
|
const { openCollection } = require('./app/collections');
|
||||||
const LastOpenedCollections = require('./store/last-opened-collections');
|
const LastOpenedCollections = require('./store/last-opened-collections');
|
||||||
const registerNetworkIpc = require('./ipc/network');
|
const registerNetworkIpc = require('./ipc/network');
|
||||||
const registerCollectionsIpc = require('./ipc/collection');
|
const registerCollectionsIpc = require('./ipc/collection');
|
||||||
@ -28,13 +29,13 @@ const contentSecurityPolicy = [
|
|||||||
setContentSecurityPolicy(contentSecurityPolicy.join(';') + ';');
|
setContentSecurityPolicy(contentSecurityPolicy.join(';') + ';');
|
||||||
|
|
||||||
const menu = Menu.buildFromTemplate(menuTemplate);
|
const menu = Menu.buildFromTemplate(menuTemplate);
|
||||||
Menu.setApplicationMenu(menu);
|
|
||||||
|
|
||||||
let mainWindow;
|
let mainWindow;
|
||||||
let watcher;
|
let watcher;
|
||||||
|
|
||||||
// Prepare the renderer once the app is ready
|
// Prepare the renderer once the app is ready
|
||||||
app.on('ready', async () => {
|
app.on('ready', async () => {
|
||||||
|
Menu.setApplicationMenu(menu);
|
||||||
const { maximized, x, y, width, height } = loadWindowState();
|
const { maximized, x, y, width, height } = loadWindowState();
|
||||||
|
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
@ -123,6 +124,7 @@ app.on('ready', async () => {
|
|||||||
// Quit the app once all windows are closed
|
// Quit the app once all windows are closed
|
||||||
app.on('window-all-closed', app.quit);
|
app.on('window-all-closed', app.quit);
|
||||||
|
|
||||||
|
// Open collection from Recent menu (#1521)
|
||||||
app.on('open-file', (event, path) => {
|
app.on('open-file', (event, path) => {
|
||||||
openCollection(mainWindow, watcher, path);
|
openCollection(mainWindow, watcher, path);
|
||||||
})
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user