Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3380794
D5868.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5868.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 2:17 AM (21 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2595456
Default Alt Text
D5868.diff (1 KB)
Attached To
Mode
D5868: [desktop] Fix error when trying to maximize after closing the window
Attached
Detach File
Event Timeline
Log In to Comment