@@ -60,8 +60,6 @@ final class TunnelManager: StorePaymentObserver {
60
60
private let observerList = ObserverList < TunnelObserver > ( )
61
61
private var networkMonitor : NWPathMonitor ?
62
62
63
- private var hasAccount = false
64
-
65
63
private var privateKeyRotationTimer : DispatchSourceTimer ?
66
64
public private( set) var isRunningPeriodicPrivateKeyRotation = false
67
65
public private( set) var nextKeyRotationDate : Date ? = nil
@@ -114,7 +112,7 @@ final class TunnelManager: StorePaymentObserver {
114
112
nslock. lock ( )
115
113
defer { nslock. unlock ( ) }
116
114
117
- guard !isRunningPeriodicPrivateKeyRotation, hasAccount else { return }
115
+ guard !isRunningPeriodicPrivateKeyRotation, deviceState . isLoggedIn else { return }
118
116
119
117
logger. debug ( " Start periodic private key rotation. " )
120
118
@@ -135,7 +133,7 @@ final class TunnelManager: StorePaymentObserver {
135
133
}
136
134
137
135
func startOrStopPeriodicPrivateKeyRotation( ) {
138
- if hasAccount {
136
+ if deviceState . isLoggedIn {
139
137
startPeriodicPrivateKeyRotation ( )
140
138
} else {
141
139
stopPeriodicPrivateKeyRotation ( )
@@ -348,7 +346,6 @@ final class TunnelManager: StorePaymentObserver {
348
346
operation. completionQueue = . main
349
347
operation. completionHandler = { [ weak self] result in
350
348
guard let self else { return }
351
- hasAccount = action. isConstructive
352
349
startOrStopPeriodicPrivateKeyRotation ( )
353
350
354
351
completionHandler ( result)
0 commit comments