mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-23 21:42:03 +01:00
Optimize viewId (#942)
This commit is contained in:
parent
159bd74566
commit
5faf793fe2
@ -26,7 +26,7 @@ public enum Visibility: String, Codable, CaseIterable, Hashable, Equatable, Send
|
||||
}
|
||||
|
||||
public protocol AnyStatus {
|
||||
var viewId: String { get }
|
||||
var viewId: StatusViewId { get }
|
||||
var id: String { get }
|
||||
var content: HTMLString { get }
|
||||
var account: Account { get }
|
||||
@ -55,12 +55,14 @@ public protocol AnyStatus {
|
||||
var language: String? { get }
|
||||
}
|
||||
|
||||
public struct StatusViewId: Hashable {
|
||||
let id: String
|
||||
let editedAt: ServerDate?
|
||||
}
|
||||
|
||||
public extension AnyStatus {
|
||||
var viewId: String {
|
||||
if let editedAt {
|
||||
return "\(id)\(editedAt.asDate.description)"
|
||||
}
|
||||
return id
|
||||
var viewId: StatusViewId {
|
||||
StatusViewId(id: id, editedAt: editedAt)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user