From 10d250686b3351645c5697bc2f65808ea89ec7de Mon Sep 17 00:00:00 2001 From: Sidharth Prabhu Date: Mon, 20 Apr 2026 20:04:40 +0530 Subject: [PATCH] Token Service updated --- .../main/java/com/rit/canteen/sales/service/TokenService.java | 4 ++-- ordering_site/src/components/BottomNav.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/com/rit/canteen/sales/service/TokenService.java b/backend/src/main/java/com/rit/canteen/sales/service/TokenService.java index 537cdfb7..8f7f6a9a 100644 --- a/backend/src/main/java/com/rit/canteen/sales/service/TokenService.java +++ b/backend/src/main/java/com/rit/canteen/sales/service/TokenService.java @@ -86,8 +86,8 @@ public class TokenService { BigDecimal currentBalance = user.getRitzTokenBalance() != null ? user.getRitzTokenBalance() : BigDecimal.ZERO; BigDecimal newBalance = currentBalance.add(amount); - if (newBalance.compareTo(new BigDecimal("5000")) > 0) { - throw new RuntimeException("Wallet limit exceeded (Max: 5,000 Ritz Tokens)"); + if (amount.compareTo(new BigDecimal("5000")) > 0) { + throw new RuntimeException("Single transaction limit exceeded (Max: 5,000 Ritz Tokens)"); } user.setRitzTokenBalance(newBalance); diff --git a/ordering_site/src/components/BottomNav.tsx b/ordering_site/src/components/BottomNav.tsx index ec7ff779..0d1ccfe6 100644 --- a/ordering_site/src/components/BottomNav.tsx +++ b/ordering_site/src/components/BottomNav.tsx @@ -14,7 +14,7 @@ const BottomNav: React.FC = () => { ]; // 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/'); if (!isMainScreen && !isStallDetail) {