Skip to content

Commit

Permalink
Fix toast error multiple time
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcoding810 committed Dec 25, 2024
1 parent 64b5ea2 commit 8543bdf
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ fun PostPage(appViewModel: AppViewModel, goBack: () -> Unit) {
var selectedImage by remember { mutableStateOf<String?>(null) }
val listState = rememberLazyListState()

uiState.error?.let {
Toast.makeText(appContext, it.message ?: it.toString(), Toast.LENGTH_SHORT).show()
LaunchedEffect(uiState.error) {
uiState.error?.let {
Toast.makeText(appContext, it.message ?: it.toString(), Toast.LENGTH_SHORT).show()
}
}

LaunchedEffect(Unit) {
Expand Down

0 comments on commit 8543bdf

Please sign in to comment.