Skip to content

Commit

Permalink
Merge pull request #48962 from CyberAndrii/43656-fix-app-crash-2
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrous committed Sep 17, 2024
2 parents d5f604e + 1bf6e4f commit 2702e38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {allowStaleData: true, initialValue: {}});
const [betas] = useOnyx(ONYXKEYS.BETAS);
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const [parentReportAction] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportOnyx?.parentReportID || 0}`, {
const [parentReportAction] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportOnyx?.parentReportID || -1}`, {
canEvict: false,
selector: (parentReportActions) => getParentReportAction(parentReportActions, reportOnyx?.parentReportActionID ?? ''),
});
Expand Down Expand Up @@ -391,8 +391,14 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
*/
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const isLoading = isLoadingApp || !reportIDFromRoute || (!isSidebarLoaded && !isInNarrowPaneModal) || PersonalDetailsUtils.isPersonalDetailsEmpty();

const shouldShowSkeleton =
(isLinkingToMessage && !isLinkedMessagePageReady) || (!isLinkingToMessage && !isInitialPageReady) || isLoadingReportOnyx || !isCurrentReportLoadedFromOnyx || isLoading;
(isLinkingToMessage && !isLinkedMessagePageReady) ||
(!isLinkingToMessage && !isInitialPageReady) ||
isEmptyObject(reportOnyx) ||
isLoadingReportOnyx ||
!isCurrentReportLoadedFromOnyx ||
isLoading;

// eslint-disable-next-line rulesdir/no-negated-variables
const shouldShowNotFoundLinkedAction =
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function ReportActionItem({
});
const theme = useTheme();
const styles = useThemeStyles();
const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID ?? -1}`);
const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID || -1}`);
const StyleUtils = useStyleUtils();
const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT;
const [isContextMenuActive, setIsContextMenuActive] = useState(() => ReportActionContextMenu.isActiveReportAction(action.reportActionID));
Expand Down

0 comments on commit 2702e38

Please sign in to comment.