Toggle between db in renderer and in main
This commit is contained in:
parent
12d7f24d0f
commit
f07da67c60
5 changed files with 380 additions and 120 deletions
|
@ -2066,6 +2066,7 @@ export async function startApp(): Promise<void> {
|
|||
'App loaded - messages:',
|
||||
messageReceiver.getProcessedCount()
|
||||
);
|
||||
window.sqlInitializer.goBackToMainProcess();
|
||||
const attachmentDownloadQueue = window.attachmentDownloadQueue || [];
|
||||
const THREE_DAYS_AGO = Date.now() - 3600 * 72 * 1000;
|
||||
const MAX_ATTACHMENT_MSGS_TO_DOWNLOAD = 250;
|
||||
|
|
488
ts/sql/Client.ts
488
ts/sql/Client.ts
File diff suppressed because it is too large
Load diff
|
@ -398,6 +398,12 @@ export type ClientInterface = DataInterface & {
|
|||
// Client-side only, and test-only
|
||||
|
||||
_removeConversations: (ids: Array<string>) => Promise<void>;
|
||||
_jobs: { [id: string]: ClientJobType };
|
||||
|
||||
// These are defined on the server-only and used in the client to determine
|
||||
// whether we should use IPC to use the database in the main process or
|
||||
// use the db already running in the renderer.
|
||||
goBackToMainProcess: () => void;
|
||||
};
|
||||
|
||||
export type ClientJobType = {
|
||||
|
|
|
@ -14,3 +14,7 @@ export async function initialize(): Promise<void> {
|
|||
|
||||
await sql.initializeRenderer({ configDir, key });
|
||||
}
|
||||
|
||||
export function goBackToMainProcess(): void {
|
||||
window.Signal.Data.goBackToMainProcess();
|
||||
}
|
||||
|
|
1
ts/window.d.ts
vendored
1
ts/window.d.ts
vendored
|
@ -250,6 +250,7 @@ declare global {
|
|||
updateTrayIcon: (count: number) => void;
|
||||
sqlInitializer: {
|
||||
initialize: () => Promise<void>;
|
||||
goBackToMainProcess: () => void;
|
||||
};
|
||||
|
||||
Backbone: typeof Backbone;
|
||||
|
|
Loading…
Reference in a new issue