Skip to content

Commit

Permalink
feat: Custom menu bar for OAuth2 window
Browse files Browse the repository at this point in the history
  • Loading branch information
Its-treason committed Nov 20, 2024
1 parent af37a49 commit 43756d7
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@
* This file is part of bruno-electron.
* For license information, see the file LICENSE_GPL3 at the root directory of this distribution.
*/
import { BrowserWindow, session } from 'electron';
import { BrowserWindow, Menu, session } from 'electron';
const { preferencesUtil } = require('../store/preferences');

const oAuthMenu = Menu.buildFromTemplate([
{
label: 'File',
submenu: [{ role: 'close' }]
},
{ role: 'editMenu' },
{ role: 'viewMenu' },
{ role: 'windowMenu' }
]);

export async function handleAuthorizationCodeInElectron(
authorizeUrl: string,
callbackUrl: string,
Expand All @@ -19,6 +29,8 @@ export async function handleAuthorizationCodeInElectron(
});
window.on('ready-to-show', () => window.show());

window.setMenu(oAuthMenu);

// Ignore invalid ssl certificates based on the app setting. See: https://github.com/usebruno/bruno/issues/1684
window.webContents.on('certificate-error', (event, _url, _error, _certificate, callback) => {
event.preventDefault();
Expand Down

0 comments on commit 43756d7

Please sign in to comment.