Skip to content

Commit

Permalink
[fix]: appAddViewModel init시 delay추가 하여 nullpointException 방지
Browse files Browse the repository at this point in the history
  • Loading branch information
jihyun0v0 committed Mar 15, 2024
1 parent b97241d commit 1cc21c7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.lifecycle.viewModelScope
import com.hmh.hamyeonham.challenge.appadd.appselection.AppSelectionModel
import com.hmh.hamyeonham.challenge.usecase.GetInstalledAppUseCase
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asSharedFlow
Expand All @@ -30,6 +31,7 @@ class AppAddViewModel @Inject constructor(
) : ViewModel() {
private fun getInstalledApps() {
viewModelScope.launch {
delay(50)
val installApps = getInstalledAppUseCase()
updateState {
copy(installedApp = installApps)
Expand Down

0 comments on commit 1cc21c7

Please sign in to comment.