Upgrade to electron 31
This commit is contained in:
parent
abd1e8c6da
commit
1a4d173bb4
3 changed files with 14 additions and 11 deletions
|
@ -37,7 +37,7 @@
|
||||||
"@typescript-eslint/parser": "^7.2.0",
|
"@typescript-eslint/parser": "^7.2.0",
|
||||||
"@vencord/types": "^1.8.4",
|
"@vencord/types": "^1.8.4",
|
||||||
"dotenv": "^16.4.5",
|
"dotenv": "^16.4.5",
|
||||||
"electron": "^29.1.1",
|
"electron": "^31.0.1",
|
||||||
"electron-builder": "^24.13.3",
|
"electron-builder": "^24.13.3",
|
||||||
"esbuild": "^0.20.1",
|
"esbuild": "^0.20.1",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
|
|
|
@ -38,8 +38,8 @@ importers:
|
||||||
specifier: ^16.4.5
|
specifier: ^16.4.5
|
||||||
version: 16.4.5
|
version: 16.4.5
|
||||||
electron:
|
electron:
|
||||||
specifier: ^29.1.1
|
specifier: ^31.0.1
|
||||||
version: 29.1.1
|
version: 31.0.1
|
||||||
electron-builder:
|
electron-builder:
|
||||||
specifier: ^24.13.3
|
specifier: ^24.13.3
|
||||||
version: 24.13.3(electron-builder-squirrel-windows@24.13.3(dmg-builder@24.13.3))
|
version: 24.13.3(electron-builder-squirrel-windows@24.13.3(dmg-builder@24.13.3))
|
||||||
|
@ -1080,8 +1080,8 @@ packages:
|
||||||
electron-publish@24.13.1:
|
electron-publish@24.13.1:
|
||||||
resolution: {integrity: sha512-2ZgdEqJ8e9D17Hwp5LEq5mLQPjqU3lv/IALvgp+4W8VeNhryfGhYEQC/PgDPMrnWUp+l60Ou5SJLsu+k4mhQ8A==}
|
resolution: {integrity: sha512-2ZgdEqJ8e9D17Hwp5LEq5mLQPjqU3lv/IALvgp+4W8VeNhryfGhYEQC/PgDPMrnWUp+l60Ou5SJLsu+k4mhQ8A==}
|
||||||
|
|
||||||
electron@29.1.1:
|
electron@31.0.1:
|
||||||
resolution: {integrity: sha512-cXN15NgCi7MkzGo5/23ZQbii+0UfhmUiDjACunmzcUofYCjF42XhFbL7JZnwgI0qtBCCeJU8qZNZt9lU91gUFw==}
|
resolution: {integrity: sha512-2eBcp4iqLkTsml6mMq+iqrS5u3kJ/2mpOLP7Mj7lo0uNK3OyfNqRS9z1ArsHjBF2/HV250Te/O9nKrwQRTX/+g==}
|
||||||
engines: {node: '>= 12.20.55'}
|
engines: {node: '>= 12.20.55'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
|
@ -1441,6 +1441,7 @@ packages:
|
||||||
|
|
||||||
glob@7.2.3:
|
glob@7.2.3:
|
||||||
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
|
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
|
||||||
|
deprecated: Glob versions prior to v9 are no longer supported
|
||||||
|
|
||||||
global-agent@3.0.0:
|
global-agent@3.0.0:
|
||||||
resolution: {integrity: sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==}
|
resolution: {integrity: sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==}
|
||||||
|
@ -3651,7 +3652,7 @@ snapshots:
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
electron@29.1.1:
|
electron@31.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@electron/get': 2.0.3
|
'@electron/get': 2.0.3
|
||||||
'@types/node': 20.11.26
|
'@types/node': 20.11.26
|
||||||
|
|
|
@ -12,12 +12,14 @@ export function registerMediaPermissionsHandler() {
|
||||||
session.defaultSession.setPermissionRequestHandler(async (_webContents, permission, callback, details) => {
|
session.defaultSession.setPermissionRequestHandler(async (_webContents, permission, callback, details) => {
|
||||||
let granted = true;
|
let granted = true;
|
||||||
|
|
||||||
|
if ("mediaTypes" in details) {
|
||||||
if (details.mediaTypes?.includes("audio")) {
|
if (details.mediaTypes?.includes("audio")) {
|
||||||
granted = await systemPreferences.askForMediaAccess("microphone");
|
granted &&= await systemPreferences.askForMediaAccess("microphone");
|
||||||
}
|
}
|
||||||
if (details.mediaTypes?.includes("video")) {
|
if (details.mediaTypes?.includes("video")) {
|
||||||
granted &&= await systemPreferences.askForMediaAccess("camera");
|
granted &&= await systemPreferences.askForMediaAccess("camera");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
callback(granted);
|
callback(granted);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue