mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 17:08:57 +01:00
Update electron to 16.0.4
This commit is contained in:
+23
-9
@@ -23,6 +23,7 @@ import {
|
||||
screen,
|
||||
shell,
|
||||
systemPreferences,
|
||||
desktopCapturer,
|
||||
} from 'electron';
|
||||
import { z } from 'zod';
|
||||
|
||||
@@ -587,11 +588,10 @@ async function createWindow() {
|
||||
|
||||
if (getEnvironment() === Environment.Test) {
|
||||
mainWindow.loadURL(
|
||||
prepareFileUrl([__dirname, '../test/index.html'], moreKeys)
|
||||
);
|
||||
} else if (getEnvironment() === Environment.TestLib) {
|
||||
mainWindow.loadURL(
|
||||
prepareFileUrl([__dirname, '../libtextsecure/test/index.html'], moreKeys)
|
||||
prepareFileUrl([__dirname, '../test/index.html'], {
|
||||
...moreKeys,
|
||||
argv: JSON.stringify(process.argv),
|
||||
})
|
||||
);
|
||||
} else {
|
||||
mainWindow.loadURL(
|
||||
@@ -1424,10 +1424,7 @@ app.on('ready', async () => {
|
||||
|
||||
addSensitivePath(userDataPath);
|
||||
|
||||
if (
|
||||
getEnvironment() !== Environment.Test &&
|
||||
getEnvironment() !== Environment.TestLib
|
||||
) {
|
||||
if (getEnvironment() !== Environment.Test) {
|
||||
installFileHandler({
|
||||
protocol: electronProtocol,
|
||||
userDataPath,
|
||||
@@ -2120,3 +2117,20 @@ ipc.handle('show-save-dialog', async (_event, { defaultPath }) => {
|
||||
defaultPath,
|
||||
});
|
||||
});
|
||||
|
||||
ipc.handle('getScreenCaptureSources', async () => {
|
||||
return desktopCapturer.getSources({
|
||||
fetchWindowIcons: true,
|
||||
thumbnailSize: { height: 102, width: 184 },
|
||||
types: ['window', 'screen'],
|
||||
});
|
||||
});
|
||||
|
||||
if (isTestEnvironment(getEnvironment())) {
|
||||
ipc.handle('ci:test-electron:done', async (_event, info) => {
|
||||
process.stdout.write(
|
||||
`ci:test-electron:done=${JSON.stringify(info)}\n`,
|
||||
() => app.quit()
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
+12
-2
@@ -2,19 +2,29 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { join } from 'path';
|
||||
import { mkdirSync } from 'fs';
|
||||
import { app } from 'electron';
|
||||
|
||||
import { start } from './base_config';
|
||||
import config from './config';
|
||||
|
||||
let userData: string | undefined;
|
||||
// Use separate data directory for benchmarks & development
|
||||
if (config.has('storagePath')) {
|
||||
app.setPath('userData', String(config.get('storagePath')));
|
||||
userData = String(config.get('storagePath'));
|
||||
} else if (config.has('storageProfile')) {
|
||||
const userData = join(
|
||||
userData = join(
|
||||
app.getPath('appData'),
|
||||
`Signal-${config.get('storageProfile')}`
|
||||
);
|
||||
}
|
||||
|
||||
if (userData !== undefined) {
|
||||
try {
|
||||
mkdirSync(userData, { recursive: true });
|
||||
} catch (error) {
|
||||
console.error('Failed to create userData', error?.stack || String(error));
|
||||
}
|
||||
|
||||
app.setPath('userData', userData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user