mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-22 05:50:11 +00:00
fix the incognito preference ordering, and register new profiles earlier on iOS
Move appPreferences.incognito.set(true) inside the success branch: written before the call that can fail, it left the app-wide default on so the next connection silently used a random profile. Mirror of the profile-path bug fixed two blocks above; iOS does not have it. Register the created profile in chatModel.users right after creation rather than after the ownership guard, so a user switch mid-create cannot leave a profile that exists in the database but in no list the app shows. Replaces the later fallbacks, which this subsumes. Also correct the plan on simplex-chat-client/typescript: it does import the regenerated types package, and is insulated by a ^0.3.0 pin, not by having its own types - adding the field there would break it.
This commit is contained in:
+4
-1
@@ -413,9 +413,12 @@ fun ActiveProfilePicker(
|
||||
switchingProfile.value = true
|
||||
withApi {
|
||||
try {
|
||||
appPreferences.incognito.set(true)
|
||||
val conn = controller.apiSetConnectionIncognito(rhId, contactConnection.pccConnId, true)
|
||||
if (conn != null) {
|
||||
// Only once the connection is actually incognito, as on the profile path
|
||||
// above: set before the call, a failure leaves the app-wide default on and
|
||||
// the next connection silently uses a random profile.
|
||||
appPreferences.incognito.set(true)
|
||||
withContext(Dispatchers.Main) {
|
||||
chatModel.chatsContext.updateContactConnection(rhId, conn)
|
||||
updateShownConnection(conn)
|
||||
|
||||
Reference in New Issue
Block a user