mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Improve cold start performance
This commit is contained in:
16
ts/sql/initialize.ts
Normal file
16
ts/sql/initialize.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { ipcRenderer as ipc } from 'electron';
|
||||
import fs from 'fs-extra';
|
||||
import pify from 'pify';
|
||||
import sql from './Server';
|
||||
|
||||
const getRealPath = pify(fs.realpath);
|
||||
|
||||
export async function initialize(): Promise<void> {
|
||||
const configDir = await getRealPath(ipc.sendSync('get-user-data-path'));
|
||||
const key = ipc.sendSync('user-config-key');
|
||||
|
||||
await sql.initializeRenderer({ configDir, key });
|
||||
}
|
||||
Reference in New Issue
Block a user