-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MM-61271] Upgrade to Electron v33.0.2 #3181
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
diff --git a/node_modules/electron/electron.d.ts b/node_modules/electron/electron.d.ts | ||
index 2de7557..0d0fa34 100644 | ||
--- a/node_modules/electron/electron.d.ts | ||
+++ b/node_modules/electron/electron.d.ts | ||
@@ -9847,23 +9847,23 @@ declare namespace Electron { | ||
* | ||
* @platform darwin,win32 | ||
*/ | ||
- on(event: 'speed-limit-change', listener: () => void): this; | ||
+ on(event: 'speed-limit-change', listener: (limit: number) => void): this; | ||
/** | ||
* @platform darwin,win32 | ||
*/ | ||
- off(event: 'speed-limit-change', listener: () => void): this; | ||
+ off(event: 'speed-limit-change', listener: (limit: number) => void): this; | ||
/** | ||
* @platform darwin,win32 | ||
*/ | ||
- once(event: 'speed-limit-change', listener: () => void): this; | ||
+ once(event: 'speed-limit-change', listener: (limit: number) => void): this; | ||
/** | ||
* @platform darwin,win32 | ||
*/ | ||
- addListener(event: 'speed-limit-change', listener: () => void): this; | ||
+ addListener(event: 'speed-limit-change', listener: (limit: number) => void): this; | ||
/** | ||
* @platform darwin,win32 | ||
*/ | ||
- removeListener(event: 'speed-limit-change', listener: () => void): this; | ||
+ removeListener(event: 'speed-limit-change', listener: (limit: number) => void): this; | ||
/** | ||
* Emitted when the system is suspending. | ||
*/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
// See LICENSE.txt for license information. | ||
'use strict'; | ||
|
||
import type {MenuItemConstructorOptions, MenuItem, BrowserWindow} from 'electron'; | ||
import type {MenuItemConstructorOptions, MenuItem} from 'electron'; | ||
import {app, ipcMain, Menu, session, shell, clipboard} from 'electron'; | ||
import log from 'electron-log'; | ||
|
||
|
@@ -149,14 +149,16 @@ export function createTemplate(config: Config, updateManager: UpdateManager) { | |
} | ||
return 'Ctrl+Shift+I'; | ||
})(), | ||
click(item: Electron.MenuItem, focusedWindow?: BrowserWindow) { | ||
if (focusedWindow) { | ||
// toggledevtools opens it in the last known position, so sometimes it goes below the browserview | ||
if (focusedWindow.webContents.isDevToolsOpened()) { | ||
focusedWindow.webContents.closeDevTools(); | ||
} else { | ||
focusedWindow.webContents.openDevTools({mode: 'detach'}); | ||
} | ||
click() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This used to matter when we had the Settings and Main windows, but now we just have the main one so we can assume we're using that one. |
||
const mainWindow = MainWindow.get(); | ||
if (!mainWindow) { | ||
return; | ||
} | ||
|
||
if (mainWindow.webContents.isDevToolsOpened()) { | ||
mainWindow.webContents.closeDevTools(); | ||
} else { | ||
mainWindow.webContents.openDevTools({mode: 'detach'}); | ||
} | ||
}, | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch is needed due to an issue in Electron's typing for this module that caused a bug. A fix is waiting to be merged, but for now we'll use this patch.
electron/electron#44391