diff --git a/app/src/main/java/eu/m724/vastapp/activity/dashboard/DashboardViewModel.kt b/app/src/main/java/eu/m724/vastapp/activity/dashboard/DashboardViewModel.kt index 8d2dec7..34b4ca9 100644 --- a/app/src/main/java/eu/m724/vastapp/activity/dashboard/DashboardViewModel.kt +++ b/app/src/main/java/eu/m724/vastapp/activity/dashboard/DashboardViewModel.kt @@ -5,7 +5,7 @@ import eu.m724.vastapp.vastai.ApiRoute import eu.m724.vastapp.vastai.VastApi import eu.m724.vastapp.vastai.api.InstancesUrlRequestCallback import eu.m724.vastapp.vastai.api.UserUrlRequestCallback -import eu.m724.vastapp.vastai.data.Instance +import eu.m724.vastapp.vastai.data.RentedInstance import eu.m724.vastapp.vastai.data.User import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow @@ -19,8 +19,8 @@ class DashboardViewModel(initialUser: User, private val vastApi: VastApi) : View val uiState: StateFlow = _uiState.asStateFlow() - private val _rentedInstances: MutableStateFlow> = MutableStateFlow(emptyList()) - val rentedInstances: StateFlow> = _rentedInstances.asStateFlow() + private val _rentedInstances: MutableStateFlow> = MutableStateFlow(emptyList()) + val rentedInstances: StateFlow> = _rentedInstances.asStateFlow() private val _user: MutableStateFlow = MutableStateFlow(initialUser) val user: StateFlow = _user.asStateFlow() diff --git a/app/src/main/java/eu/m724/vastapp/vastai/api/InstancesUrlRequestCallback.kt b/app/src/main/java/eu/m724/vastapp/vastai/api/InstancesUrlRequestCallback.kt index 5f49d47..29e43c2 100644 --- a/app/src/main/java/eu/m724/vastapp/vastai/api/InstancesUrlRequestCallback.kt +++ b/app/src/main/java/eu/m724/vastapp/vastai/api/InstancesUrlRequestCallback.kt @@ -1,7 +1,7 @@ package eu.m724.vastapp.vastai.api import eu.m724.vastapp.vastai.ApiFailure -import eu.m724.vastapp.vastai.data.Instance +import eu.m724.vastapp.vastai.data.RentedInstance import org.chromium.net.CronetException import org.chromium.net.UrlRequest import org.chromium.net.UrlResponseInfo @@ -10,7 +10,7 @@ import java.nio.ByteBuffer import java.nio.charset.CodingErrorAction class InstancesUrlRequestCallback( - val onSuccess: (List) -> Unit, + val onSuccess: (List) -> Unit, val onFailure: (ApiFailure) -> Unit ) : UrlRequest.Callback() { @@ -43,11 +43,11 @@ class InstancesUrlRequestCallback( println(stringResponse) // TODO don't do that if (info?.httpStatusCode == 200) { val jsonResponse = JSONObject(stringResponse.toString()) - val instances = ArrayList() + val instances = ArrayList() val instancesJson = jsonResponse.getJSONArray("instances") for (i in 0..