Skip to content

Commit 68a4233

Browse files
committed
fix Expense - IOU preview empty state after clearing cache
1 parent a5fc237 commit 68a4233

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
@@ -382,6 +382,8 @@ function MoneyRequestReportPreviewContent({
382382
[action?.childStateNum, action?.childStatusNum, iouReport?.stateNum, iouReport?.statusNum, translate],
383383
);
384384

385+
const shouldShowReportStatus = !!reportStatus && !!expenseCount;
386+
385387
const reportStatusColorStyle = useMemo(
386388
() => getReportStatusColorStyle(theme, iouReport?.stateNum ?? action?.childStateNum, iouReport?.statusNum ?? action?.childStatusNum),
387389
[action?.childStateNum, action?.childStatusNum, iouReport?.stateNum, iouReport?.statusNum, theme],
@@ -634,7 +636,7 @@ function MoneyRequestReportPreviewContent({
634636
) : null,
635637
[CONST.REPORT.REPORT_PREVIEW_ACTIONS.VIEW]: (
636638
<Button
637-
text={shouldShowAccessPlaceHolder ? translate('common.viewReport') : translate('common.view')}
639+
text={translate('common.view')}
638640
onPress={() => {
639641
openReportFromPreview();
640642
}}
@@ -735,9 +737,10 @@ function MoneyRequestReportPreviewContent({
735737
{showStatusAndSkeleton && shouldShowSkeleton ? (
736738
<MoneyReportHeaderStatusBarSkeleton />
737739
) : (
738-
(!shouldShowEmptyPlaceholder || shouldShowAccessPlaceHolder) && (
740+
(!shouldShowEmptyPlaceholder || shouldShowAccessPlaceHolder) &&
741+
(shouldShowReportStatus || !shouldShowAccessPlaceHolder) && (
739742
<View style={[styles.flexRow, styles.justifyContentStart, styles.alignItemsCenter]}>
740-
{!!reportStatus && !!expenseCount && (
743+
{shouldShowReportStatus && (
741744
<View
742745
style={[
743746
styles.reportStatusContainer,

src/languages/de.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,6 @@ const translations: TranslationDeepObject<typeof en> = {
647647
copyToClipboard: 'In die Zwischenablage kopieren',
648648
thisIsTakingLongerThanExpected: 'Das dauert länger als erwartet ...',
649649
domains: 'Domänen',
650-
viewReport: 'Bericht anzeigen',
651650
actionRequired: 'Aktion erforderlich',
652651
duplicate: 'Duplizieren',
653652
duplicated: 'Dupliziert',

src/languages/en.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ const translations = {
301301
wallet: 'Wallet',
302302
preferences: 'Preferences',
303303
view: 'View',
304-
viewReport: 'View report',
305304
review: (reviewParams?: ReviewParams) => `Review${reviewParams?.amount ? ` ${reviewParams?.amount}` : ''}`,
306305
not: 'Not',
307306
signIn: 'Sign in',

src/languages/es.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ const translations: TranslationDeepObject<typeof en> = {
6868
wallet: 'Billetera',
6969
preferences: 'Preferencias',
7070
view: 'Ver',
71-
viewReport: 'Ver informe',
7271
review: (reviewParams) => `Revisar${reviewParams?.amount ? ` ${reviewParams?.amount}` : ''}`,
7372
not: 'No',
7473
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
@@ -649,7 +649,6 @@ const translations: TranslationDeepObject<typeof en> = {
649649
copyToClipboard: 'Copier dans le presse-papiers',
650650
thisIsTakingLongerThanExpected: 'Cela prend plus de temps que prévu...',
651651
domains: 'Domaines',
652-
viewReport: 'Voir le rapport',
653652
actionRequired: 'Action requise',
654653
duplicate: 'Dupliquer',
655654
duplicated: 'Dupliqué',

src/languages/it.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ const translations: TranslationDeepObject<typeof en> = {
648648
copyToClipboard: 'Copia negli appunti',
649649
thisIsTakingLongerThanExpected: 'Sta richiedendo più tempo del previsto...',
650650
domains: 'Domini',
651-
viewReport: 'Visualizza rendiconto',
652651
actionRequired: 'Azione richiesta',
653652
duplicate: 'Duplica',
654653
duplicated: 'Duplicato',

src/languages/ja.ts

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

src/languages/nl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ const translations: TranslationDeepObject<typeof en> = {
648648
copyToClipboard: 'Kopiëren naar klembord',
649649
thisIsTakingLongerThanExpected: 'Dit duurt langer dan verwacht...',
650650
domains: 'Domeinen',
651-
viewReport: 'Rapport bekijken',
652651
actionRequired: 'Actie vereist',
653652
duplicate: 'Dupliceren',
654653
duplicated: 'Gedupliceerd',

src/languages/pl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ const translations: TranslationDeepObject<typeof en> = {
648648
copyToClipboard: 'Kopiuj do schowka',
649649
thisIsTakingLongerThanExpected: 'To trwa dłużej, niż się spodziewaliśmy…',
650650
domains: 'Domeny',
651-
viewReport: 'Wyświetl raport',
652651
actionRequired: 'Wymagane działanie',
653652
duplicate: 'Duplikat',
654653
duplicated: 'Zduplikowano',

src/languages/pt-BR.ts

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

0 commit comments

Comments
 (0)