File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/toolkit/src/query/core/buildMiddleware Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,9 @@ export const build: SubMiddlewareBuilder = ({
70
70
const valuesArray = Array . from ( toInvalidate . values ( ) )
71
71
for ( const { queryCacheKey } of valuesArray ) {
72
72
const querySubState = state . queries [ queryCacheKey ]
73
- const subscriptionSubState = state . subscriptions [ queryCacheKey ]
74
- if ( querySubState && subscriptionSubState ) {
73
+ const subscriptionSubState = state . subscriptions [ queryCacheKey ] ?? { }
74
+
75
+ if ( querySubState ) {
75
76
if ( Object . keys ( subscriptionSubState ) . length === 0 ) {
76
77
mwApi . dispatch (
77
78
removeQueryResult ( {
@@ -80,7 +81,6 @@ export const build: SubMiddlewareBuilder = ({
80
81
)
81
82
} else if ( querySubState . status !== QueryStatus . uninitialized ) {
82
83
mwApi . dispatch ( refetchQuery ( querySubState , queryCacheKey ) )
83
- } else {
84
84
}
85
85
}
86
86
}
You can’t perform that action at this time.
0 commit comments