Skip to content

Commit a5933f7

Browse files
committed
🔧 added timeout to user prompt
1 parent 0821752 commit a5933f7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/src/main/java/com/shub39/rush/viewmodels/SearchSheetVM.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import com.shub39.rush.presentation.searchsheet.SearchSheetAction
3333
import com.shub39.rush.presentation.searchsheet.SearchSheetState
3434
import kotlinx.coroutines.Dispatchers
3535
import kotlinx.coroutines.FlowPreview
36+
import kotlinx.coroutines.delay
3637
import kotlinx.coroutines.flow.MutableStateFlow
3738
import kotlinx.coroutines.flow.SharingStarted
3839
import kotlinx.coroutines.flow.asStateFlow
@@ -161,6 +162,12 @@ class SearchSheetVM(private val stateLayer: SharedStates, private val repo: Song
161162
stateLayer.lyricsState.update {
162163
it.copy(searchState = SearchState.UserPrompt, sync = false)
163164
}
165+
166+
delay(5000)
167+
168+
stateLayer.lyricsState.update {
169+
if (it.searchState == SearchState.UserPrompt) it.copy(searchState = SearchState.Idle) else it
170+
}
164171
}
165172
}
166173

0 commit comments

Comments
 (0)