1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30

Account name handling fix

This commit is contained in:
Arkadiusz Fal 2023-04-22 17:14:22 +02:00
parent c48301c788
commit 9a594b4a8d

View File

@ -60,29 +60,13 @@ struct Account: Defaults.Serializable, Hashable, Identifiable {
instanceID.isNil
}
var shortUsername: String {
let (username, _) = credentials
guard let username,
username.count > 10
else {
return username ?? ""
}
let index = username.index(username.startIndex, offsetBy: 11)
return String(username[..<index])
}
var description: String {
guard !isPublic else {
return name
}
guard !name.isEmpty else {
return shortUsername
}
return name
let (username, _) = credentials
return username ?? name
}
var urlHost: String {