diff options
Diffstat (limited to 'android')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt | 5 | ||||
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt index ec750fbfc5..9c582480b7 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt @@ -7,6 +7,7 @@ import kotlinx.coroutines.channels.ClosedReceiveChannelException import kotlinx.coroutines.channels.actor import kotlinx.coroutines.channels.sendBlocking import kotlinx.coroutines.delay +import net.mullvad.mullvadvpn.ipc.Event import net.mullvad.mullvadvpn.ipc.Request import net.mullvad.mullvadvpn.model.GetAccountDataResult import net.mullvad.mullvadvpn.model.LoginStatus @@ -64,6 +65,10 @@ class AccountCache(private val endpoint: ServiceEndpoint) { handleNewAccountNumber(accountNumber) } + onLoginStatusChange.subscribe(this) { status -> + endpoint.sendEvent(Event.LoginStatus(status)) + } + endpoint.dispatcher.apply { registerHandler(Request.CreateAccount::class) { _ -> commandChannel.sendBlocking(Command.CreateAccount) diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt index aee7d21d39..d95e2cf6ec 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt @@ -91,6 +91,7 @@ class ServiceEndpoint( listeners.add(listener) val initialEvents = listOf( + Event.LoginStatus(accountCache.onLoginStatusChange.latestEvent), Event.SettingsUpdate(settingsListener.settings), Event.NewLocation(locationInfoCache.location), Event.WireGuardKeyStatus(keyStatusListener.keyStatus), |
