fix: Emit AccountsItemChanged when own key is generated/imported, use gray self-color until that (#7296)

Emitting an `AccountsItemChanged` event is needed for UIs to know when `Contact::get_color()` starts
returning the true color for `SELF`. Before, an address-based color was returned for a new account
which was changing to a fingerprint-based color e.g. on app restart. Now the self-color is our
favorite gray until own keypair is generated or imported e.g. via ASM.
This commit is contained in:
iequidoo
2025-10-10 14:59:22 -03:00
committed by iequidoo
parent 2d7dc7a1be
commit 0e47e89d63
3 changed files with 21 additions and 7 deletions

View File

@@ -1582,6 +1582,8 @@ impl Contact {
pub fn get_color(&self) -> u32 {
if let Some(fingerprint) = self.fingerprint() {
str_to_color(&fingerprint.hex())
} else if self.id == ContactId::SELF {
0x808080
} else {
str_to_color(&self.addr.to_lowercase())
}