mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-14 04:59:56 +00:00
CreateProfile hardcoded what happens after submission, choosing between createProfileInProfiles and createProfileInNoProfileSetup inside the button handler. That conditional is a hidden premise: two call sites invoke the composable and neither can see from the call that submission behaves differently for them. Lift the choice to the callers. The callback passes raw fields rather than a Profile because the two paths do not build the same one - the no-profile-setup path drops shortDescr and passes a null remote host id - so a Profile-shaped callback would silently change its behaviour. The chatModel parameter was redundant besides: UserPicker passed the platform-level chatModel global, which the parameter merely shadowed. No behaviour change - the conditional moves verbatim into createProfileFromForm, which both call sites invoke, rather than being copied into each.