Skip to content

fix(profile): provide ProfileCreationState on every stack - #1002

Merged
bmc08gt merged 2 commits into
mainfrom
fix/profile-creation-state-scope
Oct 7, 2026
Merged

bmc08gt merged 2 commits into
mainfrom
fix/profile-creation-state-scope

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

ProfileNameScreen and ProfilePhotoScreen read ProfileCreationState from the environment, but only the two tips-stack roots (ChatTab and TipsSheetRoot) provided it. Pushing .profileName or .profilePhoto onto the you, balance, give, or buy stack would crash on the missing environment object. Nothing pushes them there today; .profileName is only pushed from TipsScreen, and nothing pushes .profilePhoto.

SessionContainer now owns one ProfileCreationState and injects it with the other session objects, so every stack and sheet finds it.

Behaviour changes:

  • The Chat tab and the tips sheet share one instance. Both bind router[.tips], but each used to hold its own state.
  • The tips sheet no longer resets the state when it closes. The Chat tab already kept it for the session, so this matches it: a name typed into an abandoned setup, or a photo picked and not uploaded, comes back on the next visit. An unuploaded pick (at most 1600px on its longest side) stays in memory until logout.
  • Logout and account switch rebuild SessionContainer, so nothing carries across accounts.

ProfileNameScreen and ProfilePhotoScreen read ProfileCreationState from
the environment, but only the two tips-stack roots (ChatTab and
TipsSheetRoot) provided it. A push of .profileName or .profilePhoto onto
the you, balance, give, or buy stack would crash on the missing
environment object. Nothing pushes them there today.

SessionContainer now owns one ProfileCreationState and injects it with
the other session objects, so every stack and sheet finds it. The Chat
tab and the tips sheet share one instance instead of each holding its
own, and a name typed into the sheet now survives closing it.
@bmc08gt bmc08gt self-assigned this Oct 7, 2026
…ment

Hosts .profileName and .profilePhoto with the app and session
environment and nothing stack-local, which is what the you, balance,
give, and buy stacks provide. With the ProfileCreationState injection
removed, both tests crash on the missing environment object.
@bmc08gt
bmc08gt merged commit 73cd870 into main Oct 7, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant