@@ -16,14 +16,12 @@ import { getSwarmPollingInstance } from '../session/apis/snode_api';
16
16
import { mnDecode , mnEncode } from '../session/crypto/mnemonic' ;
17
17
import { getOurPubKeyStrFromCache } from '../session/utils/User' ;
18
18
import { LibSessionUtil } from '../session/utils/libsession/libsession_utils' ;
19
- import { forceSyncConfigurationNowIfNeeded } from '../session/utils/sync/syncUtils' ;
20
19
import { updateConfirmModal , updateDeleteAccountModal } from '../state/ducks/modalDialog' ;
21
20
import { userActions } from '../state/ducks/user' ;
22
21
import { Registration } from './registration' ;
23
22
import { Storage , saveRecoveryPhrase , setLocalPubKey , setSignInByLinking } from './storage' ;
24
23
import { PromiseUtils } from '../session/utils' ;
25
24
import { SnodeAPI } from '../session/apis/snode_api/SNodeAPI' ;
26
- import { ReduxOnionSelectors } from '../state/selectors/onions' ;
27
25
import { tr } from '../localization/localeTools' ;
28
26
29
27
/**
@@ -269,18 +267,10 @@ export const deleteDbLocally = async () => {
269
267
window . localStorage . setItem ( 'restart-reason' , 'delete-account' ) ;
270
268
} ;
271
269
272
- export async function sendConfigMessageAndDeleteEverything ( ) {
270
+ export async function deleteAccountLocally ( ) {
273
271
try {
274
- // DELETE LOCAL DATA ONLY, NOTHING ON NETWORK
275
- window ?. log ?. info ( 'DeleteAccount => Sending a last SyncConfiguration' ) ;
276
- if ( ReduxOnionSelectors . isOnlineOutsideRedux ( ) ) {
277
- // be sure to wait for the message being effectively sent. Otherwise we won't be able to encrypt it for our devices !
278
- await forceSyncConfigurationNowIfNeeded ( true ) ;
279
- window ?. log ?. info ( 'Last configuration message sent!' ) ;
280
- } else {
281
- window ?. log ?. warn ( 'sendConfigMessageAndDeleteEverything: we are offline, just deleting' ) ;
282
- }
283
-
272
+ // Note: no point uploading a last config message as
273
+ // the user configs are being pushed after every changes made to them.
284
274
await deleteDbLocally ( ) ;
285
275
} catch ( error ) {
286
276
// if an error happened, it's not related to the delete everything on network logic as this is handled above.
0 commit comments