From 51f9ea44e01dfb0e86b8eb33617c4d13ca2cd4b0 Mon Sep 17 00:00:00 2001 From: AbdulMoizAli Date: Mon, 19 Jul 2021 03:02:36 +0500 Subject: [PATCH] create Learn More submenu --- Desktop-Client/main.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Desktop-Client/main.js b/Desktop-Client/main.js index 47c1ed8..71c796c 100644 --- a/Desktop-Client/main.js +++ b/Desktop-Client/main.js @@ -1,4 +1,11 @@ -const { app, BrowserWindow, screen } = require('electron'); +const { + app, + BrowserWindow, + screen, + Menu, + MenuItem, + shell, +} = require('electron'); const url = require('url'); const path = require('path'); @@ -18,6 +25,18 @@ function createAppWindow() { }) ); + Menu.getApplicationMenu().items[4].submenu.insert( + 0, + new MenuItem({ + label: 'Learn More', + click: async () => { + await shell.openExternal( + 'https://github.com/AbdulMoizAli/Realtime-Code-Sharing' + ); + }, + }) + ); + window.once('ready-to-show', () => { window.show(); window.focus();