mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 01:47:03 +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)
|
||||
|
||||
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 =
|
||||
runSuspendCatching<UIPost> {
|
||||
withContext(ioDispatcher) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue