Add unlink step to existing UI flow

This commit is contained in:
Fedor Indutny 2024-08-19 13:26:05 -07:00 committed by GitHub
parent 38f532cdda
commit 09bd95228d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View file

@ -7,6 +7,17 @@ import { deleteAllLogs } from '../util/deleteAllLogs';
import * as Errors from '../types/errors';
export async function deleteAllData(): Promise<void> {
try {
// This might fail if websocket closes before we receive the response, while
// still unlinking the device on the server.
await window.textsecure.server?.unlink();
} catch (error) {
log.error(
'Something went wrong unlinking device:',
Errors.toLogFormat(error)
);
}
try {
await deleteAllLogs();