mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-14 07:10:19 +00:00
Third review pass. Still not compiled - no Swift toolchain here. The compose picker's fallback had moved the chatId clear out of the do block, so it fired when the switch had FAILED - closing a prepared chat that was still perfectly valid and still owned by the active profile. It is now conditional on the switch having happened. Dismissing the form before the switch did not help either: the dismissal animates for about a third of a second, getTopViewController() keeps returning the sheet until it ends, and the local database work finishes sooner - so the alert was presented on a controller being dismissed and dropped, on the common path. The explicit dismissal is gone (the switch removes this view and its sheet anyway) and the alert is deferred past the transition. The one-time link picker's rows had no guard at all: allowsHitTesting keyed on switchingProfileByTimeout, which latches half a second late, so a second row was tappable for that whole window right after the form closed - starting a second connection change on a pccConnId the first was recreating. Both pickers now block input from the moment the work starts. In the compose picker the guard is on the branches that start work, not on the whole Button, so expanding and collapsing the list - which is local - still works, and a tap in a chat where the profile cannot be changed still explains itself. Also: that picker's other-profiles list sorted activeOrder ascending while every other list on both platforms sorts descending, which the core change made visible by giving a never-activated profile order 0; the one-time link picker's fallback now dismisses and resyncs its selection as the compose picker does; and the incognito handler's new else no longer writes incognitoEnabled, which is bound to the app-wide default and marks the invitation as used.