Skip to content

Commit

Permalink
remove unused layoutListHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
perunt committed Mar 20, 2024
1 parent 7b9e7e3 commit b4d1e39
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions src/pages/home/report/ReportActionsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ function ReportActionsView({
const network = useNetwork();
const {isSmallScreenWidth, windowHeight} = useWindowDimensions();
const contentListHeight = useRef(0);
const layoutListHeight = useRef(0);
const isFocused = useIsFocused();
const prevNetworkRef = useRef(network);
const prevAuthTokenType = usePrevious(session?.authTokenType);
Expand Down Expand Up @@ -365,27 +364,22 @@ function ReportActionsView({
/**
* Runs when the FlatList finishes laying out
*/
const recordTimeToMeasureItemLayout = useCallback(
(e: LayoutChangeEvent) => {
layoutListHeight.current = e.nativeEvent.layout.height;

if (didLayout.current) {
return;
}
const recordTimeToMeasureItemLayout = useCallback(() => {
if (didLayout.current) {
return;
}

didLayout.current = true;
Timing.end(CONST.TIMING.SWITCH_REPORT, hasCachedActionOnFirstRender ? CONST.TIMING.WARM : CONST.TIMING.COLD);
didLayout.current = true;
Timing.end(CONST.TIMING.SWITCH_REPORT, hasCachedActionOnFirstRender ? CONST.TIMING.WARM : CONST.TIMING.COLD);

// Capture the init measurement only once not per each chat switch as the value gets overwritten
if (!ReportActionsView.initMeasured) {
Performance.markEnd(CONST.TIMING.REPORT_INITIAL_RENDER);
ReportActionsView.initMeasured = true;
} else {
Performance.markEnd(CONST.TIMING.SWITCH_REPORT);
}
},
[hasCachedActionOnFirstRender],
);
// Capture the init measurement only once not per each chat switch as the value gets overwritten
if (!ReportActionsView.initMeasured) {
Performance.markEnd(CONST.TIMING.REPORT_INITIAL_RENDER);
ReportActionsView.initMeasured = true;
} else {
Performance.markEnd(CONST.TIMING.SWITCH_REPORT);
}
}, [hasCachedActionOnFirstRender]);

useEffect(() => {
// Temporary solution for handling REPORTPREVIEW. More details: https://expensify.slack.com/archives/C035J5C9FAP/p1705417778466539?thread_ts=1705035404.136629&cid=C035J5C9FAP
Expand Down

0 comments on commit b4d1e39

Please sign in to comment.