signal-desktop/ts/sql/initialize.ts

17 lines
480 B
TypeScript
Raw Normal View History

2021-03-04 21:44:57 +00:00
// 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 });
}