feat: Update ProfileNavigationItem to use a rounded corner shape with increased radius

This commit is contained in:
k1ngsterr1
2026-01-21 03:09:39 +05:00
parent 5145388e02
commit dcfbb020be
7 changed files with 105 additions and 42 deletions

View File

@@ -100,13 +100,31 @@ class AccountManager(private val context: Context) {
}
}
/**
* Update account username
*/
suspend fun updateAccountUsername(publicKey: String, username: String) {
val account = getAccount(publicKey) ?: return
val updatedAccount = account.copy(username = username)
saveAccount(updatedAccount)
}
/**
* Update account name
*/
suspend fun updateAccountName(publicKey: String, name: String) {
val account = getAccount(publicKey) ?: return
val updatedAccount = account.copy(name = name)
saveAccount(updatedAccount)
}
suspend fun clearAll() {
context.accountDataStore.edit { it.clear() }
}
private fun serializeAccounts(accounts: List<EncryptedAccount>): String {
return accounts.joinToString("|||") { account ->
"${account.publicKey}::${account.encryptedPrivateKey}::${account.encryptedSeedPhrase}::${account.name}"
"${account.publicKey}::${account.encryptedPrivateKey}::${account.encryptedSeedPhrase}::${account.name}::${account.username ?: ""}"
}
}
@@ -120,7 +138,8 @@ class AccountManager(private val context: Context) {
publicKey = parts[0],
encryptedPrivateKey = parts[1],
encryptedSeedPhrase = parts[2],
name = parts[3]
name = parts[3],
username = parts.getOrNull(4)?.takeIf { it.isNotBlank() }
)
} else null
}
@@ -131,7 +150,8 @@ data class EncryptedAccount(
val publicKey: String,
val encryptedPrivateKey: String,
val encryptedSeedPhrase: String,
val name: String = "Account"
val name: String = "Account",
val username: String? = null
)
data class DecryptedAccount(