mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Account name handling fix
This commit is contained in:
parent
c48301c788
commit
9a594b4a8d
@ -60,29 +60,13 @@ struct Account: Defaults.Serializable, Hashable, Identifiable {
|
|||||||
instanceID.isNil
|
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 {
|
var description: String {
|
||||||
guard !isPublic else {
|
guard !isPublic else {
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
guard !name.isEmpty else {
|
let (username, _) = credentials
|
||||||
return shortUsername
|
return username ?? name
|
||||||
}
|
|
||||||
|
|
||||||
return name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var urlHost: String {
|
var urlHost: String {
|
||||||
|
Loading…
Reference in New Issue
Block a user