Skip to content

Commit

Permalink
spotless and detekt
Browse files Browse the repository at this point in the history
MIFOSAC-306
  • Loading branch information
Darkeye14 committed Dec 12, 2024
1 parent 3309758 commit dfd6f4f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ private fun CenterListDbContent(
}
}

class CenterListUiStateProvider :
private class CenterListUiStateProvider :
PreviewParameterProvider<CenterListUiState> {

override val values: Sequence<CenterListUiState>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ internal fun ClientListScreen(
viewModel.refreshClientList()
},
refreshState = isRefreshing,
onClientSelect = onClientSelect
onClientSelect = onClientSelect,
)

}

@Composable
Expand All @@ -117,7 +116,7 @@ internal fun ClientListScreen(
onRefresh: () -> Unit,
refreshState: Boolean,
onClientSelect: (Int) -> Unit,
){
) {
val snackbarHostState = remember { SnackbarHostState() }
val swipeRefreshState = rememberSwipeRefreshState(isRefreshing = refreshState)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,11 @@ import com.mifos.core.common.utils.Resource
import com.mifos.core.data.repository.ClientListRepository
import com.mifos.core.datastore.PrefManager
import com.mifos.core.domain.useCases.GetClientListDbUseCase
import com.mifos.core.objects.client.Client
import com.mifos.core.objects.client.Page
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import rx.Subscriber
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers
import javax.inject.Inject

/**
Expand Down Expand Up @@ -69,8 +64,8 @@ class ClientListViewModel @Inject constructor(
}

private fun loadClientsFromDb() = viewModelScope.launch(Dispatchers.IO) {
getClientListDbUseCase.invoke().collect{ result ->
when(result){
getClientListDbUseCase.invoke().collect { result ->
when (result) {
is Resource.Error<*> ->
_clientListUiState.value = ClientListUiState.Error("Failed to Fetch Clients")
is Resource.Loading -> _clientListUiState.value = ClientListUiState.Empty
Expand Down

0 comments on commit dfd6f4f

Please sign in to comment.