If you want to call api at the time your Composable get composed so you can use LaunchedEffect for api call as it will execute at the time of composition only once.
p
Pablichjenkov
01/08/2023, 6:09 PM
I would separate the Error state in ErrorSeenByUser and ErrorNotSeenByUser. Then when user navigates our of that screen I would assume the user is aware of the error. Then would put the state in ErrorSeenByUser.
p
Puskal
01/09/2023, 3:44 AM
@Zaki Shaikh it is not what i am asking. FYI LaunchEffect re-run on naviagate back
d
dorche
01/09/2023, 11:58 AM
How does the user "acknowledge" that they've seen the error? That action can also tell the VM to tweak your state either to get rid of the error or like PablichJenkov says to flag it as "seen"