Skip to content

fix(compose): migrate collectAsState to lifecycle-aware and fix state issues#835

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/compose-lifecycle-state-correctness
Jun 3, 2026
Merged

fix(compose): migrate collectAsState to lifecycle-aware and fix state issues#835
bmc08gt merged 1 commit into
code/cashfrom
fix/compose-lifecycle-state-correctness

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator
  • Replace 18 collectAsState() calls with collectAsStateWithLifecycle() across 14 files to stop flow collection when backgrounded
  • Fix var LocalSheetGesturesState to val to prevent accidental reassignment of the CompositionLocal reference
  • Replace Timer() in TopBarContainer composition body with LaunchedEffect, preventing uncancelled timer creation on every recompose
  • Replace SideEffect with LaunchedEffect(cameraPermission.status) in BillContainerView to prevent permission alert firing on every recompose

@bmc08gt bmc08gt self-assigned this Jun 3, 2026
@github-actions github-actions Bot added type: fix Bug fix area: ui Compose UI, theme, components, resources area: onramp Deposit, purchase, Coinbase, fiat on-ramp area: scanner QR/Kikcode scanning, camera area: onboarding labels Jun 3, 2026
… issues

- Replace 18 collectAsState() calls with collectAsStateWithLifecycle()
  across 14 files to stop flow collection when backgrounded
- Fix var LocalSheetGesturesState to val to prevent accidental
  reassignment of the CompositionLocal reference
- Replace Timer() in TopBarContainer composition body with
  LaunchedEffect, preventing uncancelled timer creation on every recompose
- Replace SideEffect with LaunchedEffect(cameraPermission.status) in
  BillContainerView to prevent permission alert firing on every recompose
@bmc08gt bmc08gt force-pushed the fix/compose-lifecycle-state-correctness branch from ae3c9ff to 4b4f189 Compare June 3, 2026 16:27
@bmc08gt bmc08gt merged commit bc40f9e into code/cash Jun 3, 2026
3 checks passed
@bmc08gt bmc08gt deleted the fix/compose-lifecycle-state-correctness branch June 3, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: onboarding area: onramp Deposit, purchase, Coinbase, fiat on-ramp area: scanner QR/Kikcode scanning, camera area: ui Compose UI, theme, components, resources type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant