Share button

This commit is contained in:
Arkadiusz Fal
2021-10-27 00:59:59 +02:00
parent b50d915d8e
commit 544dc70c5d
11 changed files with 205 additions and 19 deletions

View File

@@ -74,6 +74,15 @@ struct Instance: Defaults.Serializable, Hashable, Identifiable {
Account(instanceID: id, name: "Anonymous", url: url, anonymous: true)
}
var urlComponents: URLComponents {
URLComponents(string: url)!
}
var frontendHost: String {
// TODO: piped frontend link
urlComponents.host!.replacingOccurrences(of: "api", with: "")
}
func hash(into hasher: inout Hasher) {
hasher.combine(url)
}