Skip to content

Commit

Permalink
change name
Browse files Browse the repository at this point in the history
  • Loading branch information
bl00mber committed May 12, 2020
1 parent d840ca5 commit 71394cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export type Context = {|
// 1. The selected root in the Components tree (if it has any profiling data) or
// 2. The first root in the list with profiling data.
rootID: number | null,
setRootIDcleanFiber: (id: number) => void,
setRootID: (id: number) => void,

// Controls whether commits are filtered by duration.
// This value is controlled by a filter toggle UI in the Profiler toolbar.
Expand Down Expand Up @@ -154,7 +154,7 @@ function ProfilerContextController({children}: Props) {
[dispatch, selectFiberID, selectFiberName, store],
);

const setRootIDcleanFiber = useCallback(
const setRootIDAndClearFiber = useCallback(
(id: number | null) => {
selectFiber(null, null);
setRootID(id);
Expand Down Expand Up @@ -182,9 +182,9 @@ function ProfilerContextController({children}: Props) {
selectedElementRootID !== null &&
dataForRoots.has(selectedElementRootID)
) {
setRootIDcleanFiber(selectedElementRootID);
setRootIDAndClearFiber(selectedElementRootID);
} else {
setRootIDcleanFiber(firstRootID);
setRootIDAndClearFiber(firstRootID);
}
}
}
Expand Down Expand Up @@ -245,7 +245,7 @@ function ProfilerContextController({children}: Props) {
supportsProfiling,

rootID,
setRootIDcleanFiber,
setRootID: setRootIDAndClearFiber,

isCommitFilterEnabled,
setIsCommitFilterEnabled,
Expand Down Expand Up @@ -275,7 +275,8 @@ function ProfilerContextController({children}: Props) {
supportsProfiling,

rootID,
setRootIDcleanFiber,
setRootID,
setRootIDAndClearFiber,

isCommitFilterEnabled,
setIsCommitFilterEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {ProfilerContext} from './ProfilerContext';
import styles from './RootSelector.css';

export default function RootSelector(_: {||}) {
const {profilingData, rootID, setRootIDcleanFiber} = useContext(
const {profilingData, rootID, setRootID} = useContext(
ProfilerContext,
);

Expand All @@ -31,9 +31,9 @@ export default function RootSelector(_: {||}) {

const handleChange = useCallback(
({currentTarget}) => {
setRootIDcleanFiber(parseInt(currentTarget.value, 10));
setRootID(parseInt(currentTarget.value, 10));
},
[setRootIDcleanFiber],
[setRootID],
);

if (profilingData === null || profilingData.dataForRoots.size <= 1) {
Expand Down

0 comments on commit 71394cd

Please sign in to comment.