Fix StatusState copying removing cached state

Closes #380
This commit is contained in:
Shadowfacts 2023-05-13 13:53:04 -04:00
parent 4ccf5d21a4
commit bf02b185ed
2 changed files with 4 additions and 2 deletions

View File

@ -24,7 +24,9 @@ public final class CollapseState: Sendable {
}
public func copy() -> CollapseState {
return CollapseState(collapsible: self.collapsible, collapsed: self.collapsed)
let new = CollapseState(collapsible: self.collapsible, collapsed: self.collapsed)
new.statusPropertiesHash = self.statusPropertiesHash
return new
}
public func hash(into hasher: inout Hasher) {

View File

@ -19,7 +19,7 @@ extension StatusEdit: CollapseStateResolving {}
extension CollapseState {
func resolveFor(status: CollapseStateResolving, height: () -> CGFloat, textLength: Int? = nil) -> Bool {
lazy var newHash = hashStatusProperties(status: status)
let newHash = hashStatusProperties(status: status)
guard unknown || statusPropertiesHash != newHash else {
return false
}