Skip to content

Commit

Permalink
Merge branch 'main' into fix/35434-report-preview-disappears-after-cl…
Browse files Browse the repository at this point in the history
…ose-error-msg
  • Loading branch information
bernhardoj committed Feb 6, 2024
2 parents bc59ba1 + ff23077 commit 8cccff6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/components/SettlementButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function SettlementButton({
}

if (iouPaymentType === CONST.IOU.REPORT_ACTION_TYPE.APPROVE) {
IOU.approveMoneyRequest(iouReport);
IOU.approveMoneyRequest(iouReport ?? {});
return;
}

Expand Down
5 changes: 2 additions & 3 deletions src/libs/API/parameters/PayMoneyRequestParams.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type CONST from '@src/CONST';
import type DeepValueOf from '@src/types/utils/DeepValueOf';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';

type PayMoneyRequestParams = {
iouReportID: string;
chatReportID: string;
reportActionID: string;
paymentMethodType: DeepValueOf<typeof CONST.IOU.PAYMENT_TYPE>;
paymentMethodType: PaymentMethodType;
};

export default PayMoneyRequestParams;
5 changes: 2 additions & 3 deletions src/libs/API/parameters/SendMoneyParams.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type CONST from '@src/CONST';
import type DeepValueOf from '@src/types/utils/DeepValueOf';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';

type SendMoneyParams = {
iouReportID: string;
chatReportID: string;
reportActionID: string;
paymentMethodType: DeepValueOf<typeof CONST.IOU.PAYMENT_TYPE>;
paymentMethodType: PaymentMethodType;
transactionID: string;
newIOUReportDetails: string;
createdReportActionID: string;
Expand Down
6 changes: 2 additions & 4 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ import type SCREENS from '@src/SCREENS';
import type * as OnyxTypes from '@src/types/onyx';
import type {Participant, Split} from '@src/types/onyx/IOU';
import type {ErrorFields, Errors} from '@src/types/onyx/OnyxCommon';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';
import type ReportAction from '@src/types/onyx/ReportAction';
import type {OnyxData} from '@src/types/onyx/Request';
import type {Comment, Receipt, ReceiptSource, TaxRate, TransactionChanges, WaypointCollection} from '@src/types/onyx/Transaction';
import type DeepValueOf from '@src/types/utils/DeepValueOf';
import type {EmptyObject} from '@src/types/utils/EmptyObject';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import * as Policy from './Policy';
Expand All @@ -63,8 +63,6 @@ type MoneyRequestRoute = StackScreenProps<MoneyRequestNavigatorParamList, typeof

type IOURequestType = ValueOf<typeof CONST.IOU.REQUEST_TYPE>;

type PaymentMethodType = DeepValueOf<typeof CONST.IOU.PAYMENT_TYPE>;

type OneOnOneIOUReport = OnyxTypes.Report | undefined | null;

type MoneyRequestInformation = {
Expand Down Expand Up @@ -3256,7 +3254,7 @@ function sendMoneyWithWallet(report: OnyxTypes.Report, amount: number, currency:
Report.notifyNewAction(params.chatReportID, managerID);
}

function approveMoneyRequest(expenseReport: OnyxTypes.Report) {
function approveMoneyRequest(expenseReport: OnyxTypes.Report | EmptyObject) {
const currentNextStep = allNextSteps[`${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`] ?? null;

const optimisticApprovedReportAction = ReportUtils.buildOptimisticApprovedReportAction(expenseReport.total ?? 0, expenseReport.currency ?? '', expenseReport.reportID);
Expand Down
6 changes: 3 additions & 3 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@
<% if (htmlWebpackPlugin.options.isWeb) { %>
<!-- polyfill.io is only needed on Web to support older browsers. It should not be loaded for desktop -->
<script src="https://polyfill.io/v3/polyfill.min.js?features=default%2CResizeObserver&flags=gated"></script>
<% if (htmlWebpackPlugin.options.isStaging) { %>
<% if (htmlWebpackPlugin.options.isProduction) { %>
<!-- Google Tag Manager - This was provided by our partner marketing agency -->
<script nonce-random-value>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-N4M3FLJZ');</script>
<script async="" src="https://www.googletagmanager.com/gtm.js?id=GTM-N4M3FLJZ"></script>
<!-- End Google Tag Manager -->
<% } %>
<% } %>
<link rel="manifest" href="/manifest.json" />
</head>
<body>
<% if (htmlWebpackPlugin.options.isWeb && htmlWebpackPlugin.options.isStaging) { %>
<% if (htmlWebpackPlugin.options.isWeb && htmlWebpackPlugin.options.isProduction) { %>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N4M3FLJZ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
Expand Down

0 comments on commit 8cccff6

Please sign in to comment.