Skip to content

Commit

Permalink
Fix retain cycle in PresentationModifier (#2697)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis authored Jan 6, 2024
1 parent 2c316f6 commit 1b1355c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,12 @@ public struct PresentationStore<
? toID($0).map { AnyIdentifiable(Identified($0) { $0 }) }
: nil
},
compactSend: {
compactSend: { [weak viewStore = self.viewStore] in
guard
let viewStore = viewStore,
$0 == nil,
self.viewStore.wrappedValue != nil,
id == nil || self.toID(self.viewStore.state) == id
viewStore.wrappedValue != nil,
id == nil || self.toID(viewStore.state) == id
else { return nil }
return .dismiss
}
Expand Down

0 comments on commit 1b1355c

Please sign in to comment.