Skip to content

Commit e86dd12

Browse files
committed
Allow updating unrelated filters while focusing a Fiber
1 parent ad54958 commit e86dd12

File tree

1 file changed

+17
-1
lines changed
  • packages/react-devtools-shared/src/devtools

1 file changed

+17
-1
lines changed

packages/react-devtools-shared/src/devtools/store.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ import {
2828
SUSPENSE_TREE_OPERATION_RESIZE,
2929
SUSPENSE_TREE_OPERATION_SUSPENDERS,
3030
} from '../constants';
31-
import {ElementTypeRoot, ElementTypeActivity} from '../frontend/types';
31+
import {
32+
ElementTypeRoot,
33+
ElementTypeActivity,
34+
ComponentFilterActivitySlice,
35+
} from '../frontend/types';
3236
import {
3337
getSavedComponentFilters,
3438
setSavedComponentFilters,
@@ -2099,6 +2103,18 @@ export default class Store extends EventEmitter<{
20992103
}
21002104
}
21012105

2106+
for (let j = 0; j < this._componentFilters.length; j++) {
2107+
const filter = this._componentFilters[j];
2108+
// If we're focusing an Activity, IDs may have changed.
2109+
if (filter.type === ComponentFilterActivitySlice) {
2110+
if (nextActivitySliceID === null || nextActivitySliceID === 0) {
2111+
filter.isValid = false;
2112+
} else {
2113+
filter.activityID = nextActivitySliceID;
2114+
}
2115+
}
2116+
}
2117+
21022118
this.emit('mutated', [
21032119
addedElementIDs,
21042120
removedElementIDs,

0 commit comments

Comments
 (0)