Skip to content

Commit b5f3786

Browse files
authored
Don't warn when dismissing two layers of tree nav (pointfreeco#3037)
Currently, popping two layers in a nav tree will cause intermediate, invalid stores to send `dismiss` actions when they shouldn't. This branch avoids this by checking the store's validity before sending the action along. Fixes pointfreeco#3031.
1 parent 9de16b3 commit b5f3786

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/ComposableArchitecture/Observation/Store+Observation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@
292292
#endif
293293
}
294294
set {
295-
if newValue == nil, self.state[keyPath: state] != nil {
295+
if newValue == nil, self.state[keyPath: state] != nil, !self._isInvalidated() {
296296
self.send(action(.dismiss))
297297
}
298298
}

0 commit comments

Comments
 (0)