Skip to content

Commit 639ca63

Browse files
remove isReportReadyForDisplay from ReportFooter and its descendants
1 parent 8b4b9ba commit 639ca63

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ type ReportActionComposeProps = Pick<ComposerWithSuggestionsProps, 'reportID' |
9999
/** The type of action that's pending */
100100
pendingAction?: OnyxCommon.PendingAction;
101101

102-
/** Whether the report is ready for display */
103-
isReportReadyForDisplay?: boolean;
104-
105102
/** A method to call when the input is focus */
106103
onComposerFocus?: () => void;
107104

@@ -127,7 +124,6 @@ function ReportActionCompose({
127124
pendingAction,
128125
report,
129126
reportID,
130-
isReportReadyForDisplay = true,
131127
lastReportAction,
132128
onComposerFocus,
133129
onComposerBlur,
@@ -409,13 +405,13 @@ function ReportActionCompose({
409405
throw new Error('The composerRefShared.clear function is not set yet. This should never happen, and indicates a developer error.');
410406
}
411407

412-
if (isSendDisabled || !isReportReadyForDisplay) {
408+
if (isSendDisabled) {
413409
return;
414410
}
415411

416412
// This will cause onCleared to be triggered where we actually send the message
417413
clearComposer();
418-
}, [isSendDisabled, isReportReadyForDisplay, composerRefShared]);
414+
}, [isSendDisabled, composerRefShared]);
419415

420416
const measureComposer = useCallback(
421417
(e: LayoutChangeEvent) => {

src/pages/home/report/ReportFooter.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ type ReportFooterProps = {
6262
/** The pending action when we are adding a chat */
6363
pendingAction?: PendingAction;
6464

65-
/** Whether the report is ready for display */
66-
isReportReadyForDisplay?: boolean;
67-
6865
/** Whether the composer is in full size */
6966
isComposerFullSize?: boolean;
7067

@@ -81,7 +78,7 @@ function ReportFooter({
8178
report = {reportID: '-1'},
8279
reportMetadata,
8380
policy,
84-
isReportReadyForDisplay = true,
81+
8582
isComposerFullSize = false,
8683
onComposerBlur,
8784
onComposerFocus,
@@ -234,7 +231,6 @@ function ReportFooter({
234231
lastReportAction={lastReportAction}
235232
pendingAction={pendingAction}
236233
isComposerFullSize={isComposerFullSize}
237-
isReportReadyForDisplay={isReportReadyForDisplay}
238234
didHideComposerInput={didHideComposerInput}
239235
reportTransactions={reportTransactions}
240236
/>
@@ -254,7 +250,6 @@ export default memo(
254250
prevProps.pendingAction === nextProps.pendingAction &&
255251
prevProps.isComposerFullSize === nextProps.isComposerFullSize &&
256252
prevProps.lastReportAction === nextProps.lastReportAction &&
257-
prevProps.isReportReadyForDisplay === nextProps.isReportReadyForDisplay &&
258253
deepEqual(prevProps.reportMetadata, nextProps.reportMetadata) &&
259254
deepEqual(prevProps.policy?.employeeList, nextProps.policy?.employeeList) &&
260255
deepEqual(prevProps.policy?.role, nextProps.policy?.role) &&

0 commit comments

Comments
 (0)