Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove settings only on app uninstall #6024

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ios/MullvadVPN/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
}

SettingsManager.resetStore(completely: true)

self.accessMethodRepository.reloadWithDefaultsAfterDataRemoval()
// At app startup, the relay cache tracker will get populated with a list of overriden IPs.
// The overriden IPs will get wiped, therefore, the cache needs to be pruned as well.
try? self.relayCacheTracker.refreshCachedRelays()
}

FirstTimeLaunch.setHasFinished()
Expand Down
5 changes: 0 additions & 5 deletions ios/MullvadVPN/TunnelManager/SetAccountOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ class SetAccountOperation: ResultOperation<StoredAccountData?> {
completion: @escaping (Result<Void, Error>) -> Void
) {
deleteAccount(accountNumber: accountNumber) { [self] result in
interactor.setSettings(LatestTunnelSettings(), persist: true)

if result.isSuccess {
interactor.removeLastUsedAccount()
}
Expand Down Expand Up @@ -231,9 +229,6 @@ class SetAccountOperation: ResultOperation<StoredAccountData?> {
)
)

// Reset tunnel settings.
interactor.setSettings(LatestTunnelSettings(), persist: true)

// Transition device state to logged in.
interactor.setDeviceState(.loggedIn(accountData, storedDeviceData), persist: true)
}
Expand Down
2 changes: 0 additions & 2 deletions ios/MullvadVPN/TunnelManager/TunnelManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,6 @@ final class TunnelManager: StorePaymentObserver {
}

private func unsetTunnelConfiguration(completion: @escaping () -> Void) {
setSettings(LatestTunnelSettings(), persist: true)

// Tell the caller to unsubscribe from VPN status notifications.
prepareForVPNConfigurationDeletion()

Expand Down
Loading