Skip to content

Commit

Permalink
Fix possible crash on restore from background
Browse files Browse the repository at this point in the history
  • Loading branch information
aabewhite committed Oct 3, 2024
1 parent 1747eae commit d1df73e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Android/app/src/main/kotlin/fire/side/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.Box
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.saveable.rememberSaveableStateHolder
import androidx.compose.ui.Alignment

Expand Down Expand Up @@ -54,6 +55,7 @@ open class MainActivity: AppCompatActivity {
val saveableStateHolder = rememberSaveableStateHolder()
saveableStateHolder.SaveableStateProvider(true) {
PresentationRootView(ComposeContext())
SideEffect { saveableStateHolder.removeState(true) }
}
}

Expand Down

0 comments on commit d1df73e

Please sign in to comment.