Skip to content

Commit 618121b

Browse files
authored
fix(navigation): use qualifiedName strings for FlowHost saved state (#783)
* refactor(theme): consolidate design system, remove legacy theme * fix(navigation): use qualifiedName strings for FlowHost saved state KClass references aren't serializable and can't survive rememberSaveable across process death. Use qualifiedName strings instead so the seeded-stack comparison works after restoration.
1 parent 2aca244 commit 618121b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • ui/navigation/src/main/kotlin/com/getcode/navigation/flow

ui/navigation/src/main/kotlin/com/getcode/navigation/flow/FlowHost.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ private fun <S : FlowStep, R : Parcelable> FlowHostImpl(
223223
// We track what was seeded and only re-seed if the backstack is still untouched.
224224
// Animation is suppressed during re-seed so NavDisplay doesn't slide between
225225
// the stale and corrected content.
226-
val seededStack = remember { initialStack.map { it::class } }
227-
val currentInitialClasses = initialStack.map { it::class }
226+
val seededStack = rememberSaveable { initialStack.map { it::class.qualifiedName } }
227+
val currentInitialClasses = initialStack.map { it::class.qualifiedName }
228228
val suppressTransition = remember { mutableStateOf(false) }
229229
LaunchedEffect(currentInitialClasses) {
230230
if (currentInitialClasses == seededStack) return@LaunchedEffect
231-
val backstackClasses = innerBackStack.map { it::class }
231+
val backstackClasses = innerBackStack.map { it::class.qualifiedName }
232232
if (backstackClasses != seededStack) return@LaunchedEffect
233233
suppressTransition.value = true
234234
Snapshot.withMutableSnapshot {

0 commit comments

Comments
 (0)