Skip to content

Commit

Permalink
Updated: swap rehydrate logic
Browse files Browse the repository at this point in the history
  • Loading branch information
juanolmedo1 committed Jan 21, 2025
1 parent 46860ef commit d10835b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions source/scenes/swap/SwapHistory/SwapHistory.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
flex-direction: column;

.historyCell {
cursor: pointer;
display: flex;
flex-direction: row;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const TransactionDetails: FC<ITransferInfo> = ({ transaction, onSupportLinkPress
>
<View style={styles.amount}>
<TextV3.BodyStrong numberOfLines={1} color={COLORS_ENUMS.BLACK}>
{transaction?.amountTo} {transaction?.coinTo.coinCode}
{transaction?.amountTo} {transaction?.coinTo?.coinCode}
</TextV3.BodyStrong>
</View>
<View style={styles.detailRow}>
Expand Down Expand Up @@ -154,7 +154,7 @@ const TransactionDetails: FC<ITransferInfo> = ({ transaction, onSupportLinkPress
color={COLORS_ENUMS.DARK_GRAY_200}
extraStyles={styles.detailValue}
>
{transaction.id}
{transaction?.id}
</TextV3.CaptionRegular>
</View>
<TouchableOpacity style={styles.supportEmail} onPress={onSupportLinkPress}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const TransactionDetails: FC<ITransferInfo> = ({ transaction, onSupportLinkPress
<div className={styles.container}>
<div className={styles.amount}>
<TextV3.BodyStrong color={COLORS_ENUMS.BLACK}>
{transaction?.amountTo} {transaction?.coinTo.coinCode}
{transaction?.amountTo} {transaction?.coinTo?.coinCode}
</TextV3.BodyStrong>
</div>
<div className={styles.detailRow}>
Expand Down
4 changes: 3 additions & 1 deletion source/state/swap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ const SwappingState = createSlice({
reducers: {
rehydrate(state: ISwapState, action: PayloadAction<ISwapState>) {
// txIds is the only key/values that are presisted for the swap state.
if (!action?.payload?.txIds?.length) return;

return {
...state,
txIds: [...state.txIds, ...action.payload.txIds],
txIds: action.payload.txIds,
};
},
setSwapFrom(state: ISwapState, action: PayloadAction<ISelectedCurrency>) {
Expand Down

0 comments on commit d10835b

Please sign in to comment.