mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Update electron to 17.3.0
This commit is contained in:
@@ -4,13 +4,13 @@
|
||||
import { join } from 'path';
|
||||
import { Worker } from 'worker_threads';
|
||||
import { format } from 'util';
|
||||
import { app } from 'electron';
|
||||
|
||||
import { strictAssert } from '../util/assert';
|
||||
import { explodePromise } from '../util/explodePromise';
|
||||
import type { LoggerType } from '../types/Logging';
|
||||
import { isCorruptionError } from './errors';
|
||||
|
||||
const ASAR_PATTERN = /app\.asar$/;
|
||||
const MIN_TRACE_DURATION = 40;
|
||||
|
||||
export type InitializeOptions = Readonly<{
|
||||
@@ -85,18 +85,8 @@ export class MainSQL {
|
||||
private onResponse = new Map<number, PromisePair<any>>();
|
||||
|
||||
constructor() {
|
||||
let appDir = join(__dirname, '..', '..');
|
||||
let isBundled = false;
|
||||
|
||||
if (ASAR_PATTERN.test(appDir)) {
|
||||
appDir = appDir.replace(ASAR_PATTERN, 'app.asar.unpacked');
|
||||
isBundled = true;
|
||||
}
|
||||
|
||||
const scriptDir = join(appDir, 'ts', 'sql');
|
||||
this.worker = new Worker(
|
||||
join(scriptDir, isBundled ? 'mainWorker.bundle.js' : 'mainWorker.js')
|
||||
);
|
||||
const scriptDir = join(app.getAppPath(), 'ts', 'sql', 'mainWorker.js');
|
||||
this.worker = new Worker(scriptDir);
|
||||
|
||||
const { promise: onCorruption, resolve: resolveCorruption } =
|
||||
explodePromise<Error>();
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
// This is a shim that gets inserted in place of `bindings` npm module when
|
||||
// building sql worker bundle.
|
||||
module.exports = (binding: string) => {
|
||||
if (binding === 'better_sqlite3.node') {
|
||||
// eslint-disable-next-line global-require, import/no-unresolved
|
||||
return require('better_sqlite3.node');
|
||||
}
|
||||
|
||||
throw new Error(`Unknown binding ${binding}`);
|
||||
};
|
||||
Reference in New Issue
Block a user