Skip to content

Commit fe7d2e6

Browse files
Merge pull request Expensify#79366 from samarroy84/fix-74639
fix Expense - IOU preview empty state after clearing cache
2 parents 781fd8f + 68a4233 commit fe7d2e6

11 files changed

Lines changed: 6 additions & 13 deletions

File tree

src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ function MoneyRequestReportPreviewContent({
384384
[action?.childStateNum, action?.childStatusNum, iouReport?.stateNum, iouReport?.statusNum, translate],
385385
);
386386

387+
const shouldShowReportStatus = !!reportStatus && !!expenseCount;
388+
387389
const reportStatusColorStyle = useMemo(
388390
() => getReportStatusColorStyle(theme, iouReport?.stateNum ?? action?.childStateNum, iouReport?.statusNum ?? action?.childStatusNum),
389391
[action?.childStateNum, action?.childStatusNum, iouReport?.stateNum, iouReport?.statusNum, theme],
@@ -643,7 +645,7 @@ function MoneyRequestReportPreviewContent({
643645
) : null,
644646
[CONST.REPORT.REPORT_PREVIEW_ACTIONS.VIEW]: (
645647
<Button
646-
text={shouldShowAccessPlaceHolder ? translate('common.viewReport') : translate('common.view')}
648+
text={translate('common.view')}
647649
onPress={() => {
648650
openReportFromPreview();
649651
}}
@@ -744,9 +746,10 @@ function MoneyRequestReportPreviewContent({
744746
{showStatusAndSkeleton && shouldShowSkeleton ? (
745747
<MoneyReportHeaderStatusBarSkeleton />
746748
) : (
747-
(!shouldShowEmptyPlaceholder || shouldShowAccessPlaceHolder) && (
749+
(!shouldShowEmptyPlaceholder || shouldShowAccessPlaceHolder) &&
750+
(shouldShowReportStatus || !shouldShowAccessPlaceHolder) && (
748751
<View style={[styles.flexRow, styles.justifyContentStart, styles.alignItemsCenter]}>
749-
{!!reportStatus && !!expenseCount && (
752+
{shouldShowReportStatus && (
750753
<View
751754
style={[
752755
styles.reportStatusContainer,

src/languages/de.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ const translations: TranslationDeepObject<typeof en> = {
626626
copyToClipboard: 'In die Zwischenablage kopieren',
627627
thisIsTakingLongerThanExpected: 'Das dauert länger als erwartet ...',
628628
domains: 'Domänen',
629-
viewReport: 'Bericht anzeigen',
630629
actionRequired: 'Aktion erforderlich',
631630
duplicate: 'Duplizieren',
632631
duplicated: 'Dupliziert',

src/languages/en.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ const translations = {
282282
wallet: 'Wallet',
283283
preferences: 'Preferences',
284284
view: 'View',
285-
viewReport: 'View report',
286285
review: (reviewParams?: ReviewParams) => `Review${reviewParams?.amount ? ` ${reviewParams?.amount}` : ''}`,
287286
not: 'Not',
288287
signIn: 'Sign in',

src/languages/es.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ const translations: TranslationDeepObject<typeof en> = {
6161
wallet: 'Billetera',
6262
preferences: 'Preferencias',
6363
view: 'Ver',
64-
viewReport: 'Ver informe',
6564
review: (reviewParams) => `Revisar${reviewParams?.amount ? ` ${reviewParams?.amount}` : ''}`,
6665
not: 'No',
6766
privacyPolicy: 'la Política de Privacidad de Expensify',

src/languages/fr.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,6 @@ const translations: TranslationDeepObject<typeof en> = {
628628
copyToClipboard: 'Copier dans le presse-papiers',
629629
thisIsTakingLongerThanExpected: 'Cela prend plus de temps que prévu...',
630630
domains: 'Domaines',
631-
viewReport: 'Voir le rapport',
632631
actionRequired: 'Action requise',
633632
duplicate: 'Dupliquer',
634633
duplicated: 'Dupliqué',

src/languages/it.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,6 @@ const translations: TranslationDeepObject<typeof en> = {
627627
copyToClipboard: 'Copia negli appunti',
628628
thisIsTakingLongerThanExpected: 'Sta richiedendo più tempo del previsto...',
629629
domains: 'Domini',
630-
viewReport: 'Visualizza rendiconto',
631630
actionRequired: 'Azione richiesta',
632631
duplicate: 'Duplica',
633632
duplicated: 'Duplicato',

src/languages/ja.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ const translations: TranslationDeepObject<typeof en> = {
626626
copyToClipboard: 'クリップボードにコピー',
627627
thisIsTakingLongerThanExpected: '予想より時間がかかっています…',
628628
domains: 'ドメイン',
629-
viewReport: 'レポートを表示',
630629
actionRequired: '対応が必要',
631630
duplicate: '複製',
632631
duplicated: '重複',

src/languages/nl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,6 @@ const translations: TranslationDeepObject<typeof en> = {
627627
copyToClipboard: 'Kopiëren naar klembord',
628628
thisIsTakingLongerThanExpected: 'Dit duurt langer dan verwacht...',
629629
domains: 'Domeinen',
630-
viewReport: 'Rapport bekijken',
631630
actionRequired: 'Actie vereist',
632631
duplicate: 'Dupliceren',
633632
duplicated: 'Gedupliceerd',

src/languages/pl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,6 @@ const translations: TranslationDeepObject<typeof en> = {
627627
copyToClipboard: 'Kopiuj do schowka',
628628
thisIsTakingLongerThanExpected: 'To trwa dłużej, niż się spodziewaliśmy…',
629629
domains: 'Domeny',
630-
viewReport: 'Wyświetl raport',
631630
actionRequired: 'Wymagane działanie',
632631
duplicate: 'Duplikat',
633632
duplicated: 'Zduplikowano',

src/languages/pt-BR.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ const translations: TranslationDeepObject<typeof en> = {
626626
copyToClipboard: 'Copiar para a área de transferência',
627627
thisIsTakingLongerThanExpected: 'Isso está levando mais tempo do que o esperado...',
628628
domains: 'Domínios',
629-
viewReport: 'Ver relatório',
630629
actionRequired: 'Ação necessária',
631630
duplicate: 'Duplicar',
632631
duplicated: 'Duplicado',

0 commit comments

Comments
 (0)