Skip to content

Commit

Permalink
feat: Added "Start New Chat" option in File menu
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Mar 1, 2023
1 parent 892dc2f commit 9e9e58e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
11 changes: 10 additions & 1 deletion src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,16 @@
tabSettings = defaultTabSettings();
}}
/>
<!-- <NewChatModal visible={$currentModal === ModalType.NewChatModal} /> -->
<NewChatModal
visible={$currentModal === ModalType.NewChatModal}
on:start-new-chat={({ detail }) => {
document.querySelector(
".active webview"
// @ts-ignore
).src = `https://web.whatsapp.com/send/?phone=${detail}`;
currentModal.set(null);
}}
/>
</div>
</main>

Expand Down
7 changes: 7 additions & 0 deletions src/util/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9e9e58e

Please sign in to comment.