Skip to content

Commit 83cd596

Browse files
puneetlathOSBotify
authored andcommitted
Merge pull request #48096 from bernhardoj/fix/48072-app-crash-after-leaving-group
Fix crash after leaving group as the last member (cherry picked from commit 9c0c647) (CP triggered by puneetlath)
1 parent 44cc4c5 commit 83cd596

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/libs/actions/ReportActions.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ function clearReportActionErrors(reportID: string, reportAction: ReportAction, k
3232
});
3333

3434
// If there's a linked transaction, delete that too
35-
const linkedTransactionID = ReportActionUtils.getLinkedTransactionID(reportAction.reportActionID, originalReportID ?? '-1');
35+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
36+
const linkedTransactionID = ReportActionUtils.getLinkedTransactionID(reportAction.reportActionID, originalReportID || '-1');
3637
if (linkedTransactionID) {
3738
Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION}${linkedTransactionID}`, null);
3839
}

src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef<Repor
211211
typeRef.current = type;
212212
reportIDRef.current = reportID ?? '-1';
213213
reportActionIDRef.current = reportActionID ?? '-1';
214-
originalReportIDRef.current = originalReportID ?? '-1';
214+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
215+
originalReportIDRef.current = originalReportID || '-1';
215216
selectionRef.current = selection;
216217
setIsPopoverVisible(true);
217218
reportActionDraftMessageRef.current = draftMessage;

src/pages/home/report/ReportActionItem.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ function ReportActionItem({
178178
const {translate} = useLocalize();
179179
const {shouldUseNarrowLayout} = useResponsiveLayout();
180180
const blockedFromConcierge = useBlockedFromConcierge();
181-
const originalReportID = useMemo(() => ReportUtils.getOriginalReportID(report.reportID, action) ?? '-1', [report.reportID, action]);
181+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
182+
const originalReportID = useMemo(() => ReportUtils.getOriginalReportID(report.reportID, action) || '-1', [report.reportID, action]);
182183
const [draftMessage] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${originalReportID}`, {
183184
selector: (draftMessagesForReport) => {
184185
const matchingDraftMessage = draftMessagesForReport?.[action.reportActionID];

0 commit comments

Comments
 (0)