From 9e9e58eab9b905976ba8c9e55204505540399912 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Wed, 1 Mar 2023 21:53:39 +0530 Subject: [PATCH] feat: Added "Start New Chat" option in File menu --- locales/en/translation.json | 3 ++- src/App.svelte | 11 ++++++++++- src/util/menu.js | 7 +++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/locales/en/translation.json b/locales/en/translation.json index 235f08d7..51fbad42 100644 --- a/locales/en/translation.json +++ b/locales/en/translation.json @@ -39,5 +39,6 @@ "Report Bugs/Issues": "Report Bugs/Issues", "Website": "Website", "Repository": "Repository", - "Open &DevTools": "Open &DevTools" + "Open &DevTools": "Open &DevTools", + "Start &New Chat": "Start &New Chat" } diff --git a/src/App.svelte b/src/App.svelte index 3ab6e9e2..cd456682 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -101,7 +101,16 @@ tabSettings = defaultTabSettings(); }} /> - + { + document.querySelector( + ".active webview" + // @ts-ignore + ).src = `https://web.whatsapp.com/send/?phone=${detail}`; + currentModal.set(null); + }} + /> diff --git a/src/util/menu.js b/src/util/menu.js index 4f29dc14..8bb9abc3 100644 --- a/src/util/menu.js +++ b/src/util/menu.js @@ -17,6 +17,13 @@ const mainMenu = (i18n) => { label: i18n.t("&File"), id: "file", submenu: [ + { + label: i18n.t("Start &New Chat"), + click() { + let window = BrowserWindow.getFocusedWindow(); + window.webContents.send("new-chat"); + }, + }, { label: i18n.t("Force &Reload"), role: "forceReload",