Skip to content

Commit

Permalink
chore: move around the timing trigger for the CHAT_FINDER_RENDER event
Browse files Browse the repository at this point in the history
  • Loading branch information
adhorodyski committed Jul 29, 2024
1 parent dbc4ad4 commit 6423ba3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import Performance from '@libs/Performance';
import SignInButton from '@pages/home/sidebar/SignInButton';
import * as Session from '@userActions/Session';
import Timing from '@userActions/Timing';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -62,7 +64,11 @@ function TopBar({breadcrumbLabel, activeWorkspaceID, shouldDisplaySearch = true}
<PressableWithoutFeedback
accessibilityLabel={translate('sidebarScreen.buttonFind')}
style={[styles.flexRow, styles.mr2, styles.touchableButtonImage]}
onPress={Session.checkIfActionIsAllowed(() => Navigation.navigate(ROUTES.CHAT_FINDER))}
onPress={Session.checkIfActionIsAllowed(() => {
Timing.start(CONST.TIMING.CHAT_FINDER_RENDER);
Performance.markStart(CONST.TIMING.CHAT_FINDER_RENDER);
Navigation.navigate(ROUTES.CHAT_FINDER);
})}
>
<Icon
src={Expensicons.MagnifyingGlass}
Expand Down
5 changes: 0 additions & 5 deletions src/pages/ChatFinderPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ function ChatFinderPage({betas, isSearchingForReports, navigation}: ChatFinderPa
);
useCancelSearchOnModalClose();

useEffect(() => {
Timing.start(CONST.TIMING.CHAT_FINDER_RENDER);
Performance.markStart(CONST.TIMING.CHAT_FINDER_RENDER);
}, []);

useEffect(() => {
Report.searchInServer(debouncedSearchValueInServer.trim());
}, [debouncedSearchValueInServer]);
Expand Down

0 comments on commit 6423ba3

Please sign in to comment.