mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 06:27:02 +05:30
parent
da3ca63085
commit
1a14095af6
1 changed files with 4 additions and 0 deletions
|
@ -45,6 +45,10 @@ constructor(
|
||||||
var postDetails by mutableStateOf<NetworkState>(NetworkState.Loading)
|
var postDetails by mutableStateOf<NetworkState>(NetworkState.Loading)
|
||||||
|
|
||||||
suspend fun loadPostDetails(postId: String) {
|
suspend fun loadPostDetails(postId: String) {
|
||||||
|
if (postDetails is NetworkState.Error) {
|
||||||
|
// If the post details failed to load previously, reset the state to loading
|
||||||
|
postDetails = NetworkState.Loading
|
||||||
|
}
|
||||||
postDetails =
|
postDetails =
|
||||||
runSuspendCatching<UIPost> {
|
runSuspendCatching<UIPost> {
|
||||||
withContext(ioDispatcher) {
|
withContext(ioDispatcher) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue