Skip to content

Commit

Permalink
Merge branch 'master' into IOPID-2322-cie-id-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMattew authored Oct 22, 2024
2 parents 4c62415 + 36d29c8 commit f609cb1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const PaymentsTransactionBizEventsListScreen = () => {

const scrollTranslationY = useSharedValue(0);
const [titleHeight, setTitleHeight] = React.useState(0);
const [isRefreshing, setIsRefreshing] = React.useState(false);
const [continuationToken, setContinuationToken] = React.useState<
string | undefined
>();
Expand Down Expand Up @@ -104,8 +105,19 @@ const PaymentsTransactionBizEventsListScreen = () => {
setTitleHeight(height);
};

const handleOnSuccess = (continuationToken?: string) => {
setContinuationToken(continuationToken);
const handleOnSuccess = (paginationToken?: string) => {
setContinuationToken(paginationToken);
setIsRefreshing(false);
};

const handleOnRefreshTransactionsList = () => {
setIsRefreshing(true);
dispatch(
getPaymentsBizEventsTransactionsAction.request({
firstLoad: true,
onSuccess: handleOnSuccess
})
);
};

useOnFirstRender(
Expand Down Expand Up @@ -192,7 +204,8 @@ const PaymentsTransactionBizEventsListScreen = () => {

return (
<AnimatedSectionList
// snapToEnd={false}
refreshing={isRefreshing}
onRefresh={handleOnRefreshTransactionsList}
scrollIndicatorInsets={{ right: 0 }}
contentContainerStyle={{
...IOStyles.horizontalContentPadding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ describe("getPayerInfoLabel", () => {
it("should return only the taxCode if name is not provided", () => {
const payer = { taxCode: "123456789" };
const result = getPayerInfoLabel(payer);
expect(result).toBe("(123456789)");
expect(result).toBe("123456789");
});

it("should return only the taxCode if name is empty string", () => {
const payer = { taxCode: "123456789", name: "" };
const result = getPayerInfoLabel(payer);
expect(result).toBe("123456789");
});

it("should return name and taxCode formatted correctly", () => {
Expand Down
5 changes: 2 additions & 3 deletions ts/features/payments/bizEventsTransaction/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ export const getPayerInfoLabel = (payer: InfoNotice["payer"]): string => {
}

const name = payer.name ? payer.name.trim() : "";
const taxCode = payer.taxCode ? `(${payer.taxCode.trim()})` : "";
const taxCode = payer.taxCode ? payer.taxCode.trim() : "";

const payerInfo =
name && taxCode ? `${name}\n${taxCode}` : `${name}${taxCode}`;
const payerInfo = name ? (taxCode ? `${name}\n(${taxCode})` : name) : taxCode;

return payerInfo.trim();
};
Expand Down

0 comments on commit f609cb1

Please sign in to comment.