From 577864915273c8ca4202611c16a16b67dec48606 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Fri, 1 Mar 2024 16:41:57 +0100 Subject: [PATCH] Kotlin format --- .../compose/communication/CustomListAction.kt | 12 +++++------- .../compose/dialog/CreateCustomListDialog.kt | 4 +--- .../mullvadvpn/repository/CustomListsRepository.kt | 2 -- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/communication/CustomListAction.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/communication/CustomListAction.kt index d9bf076e547f..0b478f5272f4 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/communication/CustomListAction.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/communication/CustomListAction.kt @@ -3,11 +3,11 @@ package net.mullvad.mullvadvpn.compose.communication import android.os.Parcelable import kotlinx.parcelize.Parcelize -sealed interface -CustomListAction : Parcelable { +sealed interface CustomListAction : Parcelable { @Parcelize - data class Rename(val customListId: String, val name: String, val newName: String) : CustomListAction { + data class Rename(val customListId: String, val name: String, val newName: String) : + CustomListAction { fun not() = this.copy(name = newName, newName = name) } @@ -17,10 +17,8 @@ CustomListAction : Parcelable { } @Parcelize - data class Create( - val name: String = "", - val locations: List = emptyList() - ) : CustomListAction, Parcelable { + data class Create(val name: String = "", val locations: List = emptyList()) : + CustomListAction, Parcelable { fun not(customListId: String) = Delete(customListId) } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CreateCustomListDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CreateCustomListDialog.kt index be3f2e763a3c..3c53f829ce57 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CreateCustomListDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CreateCustomListDialog.kt @@ -58,9 +58,7 @@ fun CreateCustomList( locationCode: String = "" ) { val vm: CreateCustomListDialogViewModel = - koinViewModel( - parameters = { parametersOf(locationCode) } - ) + koinViewModel(parameters = { parametersOf(locationCode) }) LaunchedEffect(key1 = Unit) { vm.uiSideEffect.collect { sideEffect -> when (sideEffect) { diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt index 46909fb53af1..4a0ce06efcbe 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt @@ -11,9 +11,7 @@ import net.mullvad.mullvadvpn.model.CustomList import net.mullvad.mullvadvpn.model.CustomListsError import net.mullvad.mullvadvpn.model.GeographicLocationConstraint import net.mullvad.mullvadvpn.model.UpdateCustomListResult -import net.mullvad.mullvadvpn.relaylist.RelayItem import net.mullvad.mullvadvpn.relaylist.getGeographicLocationConstraintByCode -import net.mullvad.mullvadvpn.relaylist.toGeographicLocationConstraints import net.mullvad.mullvadvpn.ui.serviceconnection.RelayListListener import net.mullvad.mullvadvpn.util.firstOrNullWithTimeout