No more type passed to removeAllConfiguration; keep more UI keys
This commit is contained in:
parent
046a3c4849
commit
d7177516c1
7 changed files with 31 additions and 51 deletions
|
@ -137,7 +137,6 @@ import {
|
|||
} from './util/handleRetry';
|
||||
import { themeChanged } from './shims/themeChanged';
|
||||
import { createIPCEvents } from './util/createIPCEvents';
|
||||
import { RemoveAllConfiguration } from './types/RemoveAllConfiguration';
|
||||
import type { ServiceIdString } from './types/ServiceId';
|
||||
import { ServiceIdKind, isServiceIdString } from './types/ServiceId';
|
||||
import { isAciString } from './util/isAciString';
|
||||
|
@ -849,7 +848,7 @@ export async function startApp(): Promise<void> {
|
|||
log.warn(
|
||||
`This instance has not been used for 30 days. Last heartbeat: ${lastHeartbeat}. Last startup: ${previousLastStartup}.`
|
||||
);
|
||||
await unlinkAndDisconnect(RemoveAllConfiguration.Soft);
|
||||
await unlinkAndDisconnect();
|
||||
}
|
||||
|
||||
// Start heartbeat timer
|
||||
|
@ -1343,7 +1342,7 @@ export async function startApp(): Promise<void> {
|
|||
});
|
||||
|
||||
window.Whisper.events.on('unlinkAndDisconnect', () => {
|
||||
void unlinkAndDisconnect(RemoveAllConfiguration.Full);
|
||||
void unlinkAndDisconnect();
|
||||
});
|
||||
|
||||
async function runStorageService() {
|
||||
|
@ -1784,7 +1783,7 @@ export async function startApp(): Promise<void> {
|
|||
|
||||
if (!window.textsecure.storage.user.getAci()) {
|
||||
log.error('UUID not captured during registration, unlinking');
|
||||
return unlinkAndDisconnect(RemoveAllConfiguration.Full);
|
||||
return unlinkAndDisconnect();
|
||||
}
|
||||
|
||||
if (connectCount === 1) {
|
||||
|
@ -1804,7 +1803,7 @@ export async function startApp(): Promise<void> {
|
|||
|
||||
if (!window.textsecure.storage.user.getPni()) {
|
||||
log.error('PNI not captured during registration, unlinking softly');
|
||||
return unlinkAndDisconnect(RemoveAllConfiguration.Soft);
|
||||
return unlinkAndDisconnect();
|
||||
}
|
||||
|
||||
if (firstRun === true && deviceId !== 1) {
|
||||
|
@ -2892,9 +2891,7 @@ export async function startApp(): Promise<void> {
|
|||
return false;
|
||||
}
|
||||
|
||||
async function unlinkAndDisconnect(
|
||||
mode: RemoveAllConfiguration
|
||||
): Promise<void> {
|
||||
async function unlinkAndDisconnect(): Promise<void> {
|
||||
window.Whisper.events.trigger('unauthorized');
|
||||
|
||||
log.warn(
|
||||
|
@ -2934,7 +2931,7 @@ export async function startApp(): Promise<void> {
|
|||
);
|
||||
|
||||
try {
|
||||
log.info(`unlinkAndDisconnect: removing configuration, mode ${mode}`);
|
||||
log.info('unlinkAndDisconnect: removing configuration');
|
||||
|
||||
// First, make changes to conversations in memory
|
||||
window.getConversations().forEach(conversation => {
|
||||
|
@ -2948,7 +2945,7 @@ export async function startApp(): Promise<void> {
|
|||
await window.Signal.Data.getItemById('manifestVersion');
|
||||
|
||||
// Finally, conversations in the database, and delete all config tables
|
||||
await window.textsecure.storage.protocol.removeAllConfiguration(mode);
|
||||
await window.textsecure.storage.protocol.removeAllConfiguration();
|
||||
|
||||
// These three bits of data are important to ensure that the app loads up
|
||||
// the conversation list, instead of showing just the QR code screen.
|
||||
|
@ -3001,7 +2998,7 @@ export async function startApp(): Promise<void> {
|
|||
error instanceof HTTPError &&
|
||||
(error.code === 401 || error.code === 403)
|
||||
) {
|
||||
void unlinkAndDisconnect(RemoveAllConfiguration.Full);
|
||||
void unlinkAndDisconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue