From f5743da2d639dbe6eb855427b987d0b0d517a559 Mon Sep 17 00:00:00 2001
From: Andreas Hatziiliou <andreas.hatziiliou@savoirfairelinux.com>
Date: Wed, 25 Sep 2024 13:09:54 -0400
Subject: [PATCH] username: fix multiple usernames associated to one account

Added logic check to prevent disabled accounts from registering
multiple usernames after being restored from an archive.

https://git.jami.net/savoirfairelinux/jami-client-android/-/issues/1765

Change-Id: I58e3e018c85e335f043f232e391286e716201481
---
 src/app/commoncomponents/JamiIdentifier.qml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/app/commoncomponents/JamiIdentifier.qml b/src/app/commoncomponents/JamiIdentifier.qml
index 9d797c2ed..a4bbc80fa 100644
--- a/src/app/commoncomponents/JamiIdentifier.qml
+++ b/src/app/commoncomponents/JamiIdentifier.qml
@@ -151,7 +151,7 @@ Item {
                 JamiIdControlButton {
                     id: btnEdit
                     anchors.leftMargin: JamiTheme.pushButtonMargins
-                    visible: CurrentAccount.registeredName === ""
+                    visible: CurrentAccount.registeredName === "" && CurrentAccount.enabled
                     imageColor: enabled ? JamiTheme.tintedBlue : JamiTheme.buttonTintedBlack
                     border.color: usernameTextEdit.editMode ? jamiId.contentColor : "transparent"
                     enabled: {
-- 
GitLab