Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show app intro again after recomposition #1142

Conversation

sunkup
Copy link
Member

@sunkup sunkup commented Nov 26, 2024

Purpose

The app intro replays after finish, when changing between dark and light theme or rotating the screen. It should not do that.

Short description

The problem is that we need to continuously consume the showAppIntro flow in order to start the app intro as soon as possible, but only want to do so once and not on every recomposition. There might be a cleaner way, but simply to

  • remember the launched state across recomposition
  • use rememberSaveable instead of remember to survive configuration changes (like screen rotation)

works just fine.

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

@sunkup sunkup added the bug Something isn't working label Nov 26, 2024
@sunkup sunkup self-assigned this Nov 26, 2024
@sunkup sunkup linked an issue Nov 26, 2024 that may be closed by this pull request
2 tasks
@sunkup sunkup requested a review from ArnyminerZ November 26, 2024 13:21
Copy link
Member

@ArnyminerZ ArnyminerZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, and it's simple enough. Though I would probably add a comment or something, since otherwise we might forget why this is here, and remove it at some point

@rfc2822 rfc2822 merged commit 4f1176f into main-ose Nov 27, 2024
8 checks passed
@rfc2822 rfc2822 deleted the 1133-intro-replays-when-changing-between-dark-and-light-theme-or-rotating-the-screen branch November 27, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intro replays when changing between dark and light theme or rotating the screen
3 participants