Page MenuHomePhabricator

D5868.id19403.diff
No OneTemporary

D5868.id19403.diff

diff --git a/desktop/src/main.js b/desktop/src/main.js
--- a/desktop/src/main.js
+++ b/desktop/src/main.js
@@ -98,12 +98,14 @@
});
};
win.webContents.on('did-navigate-in-page', updateNavigationState);
- ipcMain.on('clear-history', () => {
+
+ const clearHistory = () => {
win.webContents.clearHistory();
updateNavigationState();
- });
+ };
+ ipcMain.on('clear-history', clearHistory);
- ipcMain.on('double-click-top-bar', () => {
+ const doubleClickTopBar = () => {
if (isMac) {
// Possible values for AppleActionOnDoubleClick are Maximize,
// Minimize or None. We handle the last two inside this if.
@@ -126,10 +128,12 @@
} else {
win.maximize();
}
- });
+ };
+ ipcMain.on('double-click-top-bar', doubleClickTopBar);
- ipcMain.on('set-badge', (event, value) => {
- app.dock.setBadge(value?.toString() ?? '');
+ win.on('closed', () => {
+ ipcMain.removeListener('clear-history', clearHistory);
+ ipcMain.removeListener('double-click-top-bar', doubleClickTopBar);
});
win.webContents.setWindowOpenHandler(({ url: openURL }) => {
@@ -222,6 +226,11 @@
(async () => {
await app.whenReady();
+
+ ipcMain.on('set-badge', (event, value) => {
+ app.dock.setBadge(value?.toString() ?? '');
+ });
+
show();
app.on('activate', () => {

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 4:43 AM (20 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2595456
Default Alt Text
D5868.id19403.diff (1 KB)

Event Timeline