Skip to content

Commit

Permalink
fix: changes after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Jul 22, 2024
1 parent c6765ba commit 67a0ab5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/ProfilingToolMenu/BaseProfilingToolMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ type BaseProfilingToolMenuProps = {
pathToBeUsed: string;
/** Path used to display location of saved file */
displayPath: string;
/** Whether to show the share button */
showShareButton?: boolean;
} & BaseProfilingToolMenuOnyxProps;

function formatBytes(bytes: number, decimals = 2) {
Expand All @@ -47,7 +49,7 @@ function formatBytes(bytes: number, decimals = 2) {
// WARNING: When changing this name make sure that the "scripts/symbolicate-profile.ts" script is still working!
const newFileName = `Profile_trace_for_${pkg.version}.cpuprofile`;

function BaseProfilingToolMenu({isProfilingInProgress = false, pathToBeUsed, displayPath}: BaseProfilingToolMenuProps) {
function BaseProfilingToolMenu({isProfilingInProgress = false, showShareButton = false, pathToBeUsed, displayPath}: BaseProfilingToolMenuProps) {
const styles = useThemeStyles();
const [filePath, setFilePath] = useState('');
const [sharePath, setSharePath] = useState('');
Expand Down Expand Up @@ -158,7 +160,7 @@ function BaseProfilingToolMenu({isProfilingInProgress = false, pathToBeUsed, dis
onToggle={onToggleProfiling}
/>
</TestToolRow>
{!!filePath && getPlatform() !== CONST.PLATFORM.WEB && (
{!!filePath && showShareButton && (
<>
<Text style={[styles.textLabelSupporting, styles.mb4]}>{`path: ${displayPath}/${newFileName}`}</Text>
<TestToolRow title={translate('initialSettingsPage.troubleshoot.profileTrace')}>
Expand Down
1 change: 1 addition & 0 deletions src/components/ProfilingToolMenu/index.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function ProfilingToolMenu() {
<BaseProfilingToolMenu
pathToBeUsed={RNFS.DownloadDirectoryPath}
displayPath={`${CONST.DOWNLOADS_PATH}`}
showShareButton
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/components/ProfilingToolMenu/index.ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function ProfilingToolMenu() {
<BaseProfilingToolMenu
pathToBeUsed={RNFS.DocumentDirectoryPath}
displayPath={`${CONST.NEW_EXPENSIFY_PATH}${getDownloadFolderPathSuffixForIOS(environment)}`}
showShareButton
/>
);
}
Expand Down

0 comments on commit 67a0ab5

Please sign in to comment.