Token Service updated
This commit is contained in:
@@ -86,8 +86,8 @@ public class TokenService {
|
|||||||
BigDecimal currentBalance = user.getRitzTokenBalance() != null ? user.getRitzTokenBalance() : BigDecimal.ZERO;
|
BigDecimal currentBalance = user.getRitzTokenBalance() != null ? user.getRitzTokenBalance() : BigDecimal.ZERO;
|
||||||
BigDecimal newBalance = currentBalance.add(amount);
|
BigDecimal newBalance = currentBalance.add(amount);
|
||||||
|
|
||||||
if (newBalance.compareTo(new BigDecimal("5000")) > 0) {
|
if (amount.compareTo(new BigDecimal("5000")) > 0) {
|
||||||
throw new RuntimeException("Wallet limit exceeded (Max: 5,000 Ritz Tokens)");
|
throw new RuntimeException("Single transaction limit exceeded (Max: 5,000 Ritz Tokens)");
|
||||||
}
|
}
|
||||||
|
|
||||||
user.setRitzTokenBalance(newBalance);
|
user.setRitzTokenBalance(newBalance);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const BottomNav: React.FC = () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Only show on main screens and stall details
|
// Only show on main screens and stall details
|
||||||
const isMainScreen = ['/', '/orders', '/profile'].includes(location.pathname);
|
const isMainScreen = ['/', '/orders', '/profile', '/wallet', '/topup'].includes(location.pathname);
|
||||||
const isStallDetail = location.pathname.startsWith('/stall/');
|
const isStallDetail = location.pathname.startsWith('/stall/');
|
||||||
|
|
||||||
if (!isMainScreen && !isStallDetail) {
|
if (!isMainScreen && !isStallDetail) {
|
||||||
|
|||||||
Reference in New Issue
Block a user