Skip to content

Commit a40f9bf

Browse files
committed
Fixed some issues
1 parent e48c9d9 commit a40f9bf

File tree

7 files changed

+12
-33
lines changed

7 files changed

+12
-33
lines changed

android/app/src/main/kotlin/net/mullvad/mullvadvpn/di/UiModule.kt

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import net.mullvad.mullvadvpn.ui.serviceconnection.ServiceConnectionManager
2626
import net.mullvad.mullvadvpn.ui.serviceconnection.SplitTunneling
2727
import net.mullvad.mullvadvpn.usecase.AccountExpiryNotificationUseCase
2828
import net.mullvad.mullvadvpn.usecase.ConnectivityUseCase
29-
import net.mullvad.mullvadvpn.usecase.CustomListsUseCase
3029
import net.mullvad.mullvadvpn.usecase.EmptyPaymentUseCase
3130
import net.mullvad.mullvadvpn.usecase.NewDeviceNotificationUseCase
3231
import net.mullvad.mullvadvpn.usecase.OutOfTimeUseCase
@@ -110,7 +109,6 @@ val uiModule = module {
110109
single { RelayListUseCase(get(), get()) }
111110
single { OutOfTimeUseCase(get(), get()) }
112111
single { ConnectivityUseCase(get()) }
113-
single { CustomListsUseCase(get()) }
114112

115113
single { InAppNotificationController(get(), get(), get(), get(), MainScope()) }
116114

android/app/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/CustomListExtensions.kt

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package net.mullvad.mullvadvpn.relaylist
33
import net.mullvad.mullvadvpn.model.CustomList
44

55
fun CustomList.toRelayItemList(relayCountries: List<RelayCountry>): CustomRelayItemList =
6-
// return this.items.map { RelayItem(it) }
76
CustomRelayItemList(
87
id = this.id,
98
name = this.name,

android/app/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/RelayListExtensions.kt

+9-9
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,23 @@ fun RelayList.toRelayCountries(
7070
}
7171

7272
fun List<RelayCountry>.findItemForGeographicLocationConstraint(
73-
location: GeographicLocationConstraint
73+
constraint: GeographicLocationConstraint
7474
) =
75-
when (location) {
75+
when (constraint) {
7676
is GeographicLocationConstraint.Country -> {
77-
this.find { country -> country.code == location.countryCode }
77+
this.find { country -> country.code == constraint.countryCode }
7878
}
7979
is GeographicLocationConstraint.City -> {
80-
val country = this.find { country -> country.code == location.countryCode }
80+
val country = this.find { country -> country.code == constraint.countryCode }
8181

82-
country?.cities?.find { city -> city.code == location.cityCode }
82+
country?.cities?.find { city -> city.code == constraint.cityCode }
8383
}
8484
is GeographicLocationConstraint.Hostname -> {
85-
val country = this.find { country -> country.code == location.countryCode }
85+
val country = this.find { country -> country.code == constraint.countryCode }
8686

87-
val city = country?.cities?.find { city -> city.code == location.cityCode }
87+
val city = country?.cities?.find { city -> city.code == constraint.cityCode }
8888

89-
city?.relays?.find { relay -> relay.name == location.hostname }
89+
city?.relays?.find { relay -> relay.name == constraint.hostname }
9090
}
9191
}
9292

@@ -230,7 +230,7 @@ private fun List<RelayCountry>.expandItemForSelection(
230230
}
231231
}
232232
}
233-
else -> this
233+
null -> this
234234
}
235235
} ?: this
236236
}

android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CustomListsRepository(private val messageHandler: MessageHandler) {
1212
val result = messageHandler.trySendRequest(Request.CreateCustomList(name))
1313

1414
return if (result) {
15-
messageHandler.events<Event.CreateCustomListResultEvent>().first().result
15+
messageHandler.events<Event.CreateCustomListResult>().first().listId
1616
} else {
1717
null
1818
}

android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/CustomListsUseCase.kt

-18
This file was deleted.

android/lib/ipc/src/main/kotlin/net/mullvad/mullvadvpn/lib/ipc/Event.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ sealed class Event : Message.EventMessage() {
6565

6666
@Parcelize object VpnPermissionRequest : Event()
6767

68-
@Parcelize data class CreateCustomListResultEvent(val result: String) : Event()
68+
@Parcelize data class CreateCustomListResult(val listId: String) : Event()
6969

7070
companion object {
7171
private const val MESSAGE_KEY = "event"

android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/CustomLists.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class CustomLists(
4040

4141
private suspend fun createCustomList(name: String) {
4242
val result = daemon.await().createCustomList(name)
43-
endpoint.sendEvent(Event.CreateCustomListResultEvent(result))
43+
endpoint.sendEvent(Event.CreateCustomListResult(result))
4444
}
4545

4646
fun onDestroy() {

0 commit comments

Comments
 (0)