Better sync between convo and protocol stores

This commit is contained in:
Fedor Indutny 2024-05-31 07:15:43 -07:00 committed by GitHub
parent 442cc43b94
commit fbf91a4d79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 195 additions and 14 deletions

View file

@ -34,6 +34,7 @@ export type CIType = {
) => unknown;
openSignalRoute(url: string): Promise<void>;
exportBackupToDisk(path: string): Promise<void>;
unlink: () => void;
};
export type GetCIOptionsType = Readonly<{
@ -162,6 +163,10 @@ export function getCI({ deviceName, backupData }: GetCIOptionsType): CIType {
await backupsService.exportToDisk(path);
}
function unlink() {
window.Whisper.events.trigger('unlinkAndDisconnect');
}
return {
deviceName,
backupData,
@ -173,5 +178,6 @@ export function getCI({ deviceName, backupData }: GetCIOptionsType): CIType {
waitForEvent,
openSignalRoute,
exportBackupToDisk,
unlink,
};
}