feat: enhance wallet functionality and improve error handling
- Updated .env.example to include optional player site code configuration. - Modified error messages in hall-bet-errors for better clarity. - Improved the betting grid logic to handle invalid draw IDs and reload draws when necessary. - Adjusted wallet components to differentiate between credit and main wallet balances, including new translations for credit-related terms. - Enhanced wallet logs to support credit activity tracking and improved UI for displaying credit information.
This commit is contained in:
@@ -978,6 +978,9 @@ export function HallBettingGrid({ drawLive }: { drawLive: HallDrawLiveSnapshot }
|
||||
setPreviewData(null);
|
||||
clearPlaceTraceId();
|
||||
}
|
||||
if (e instanceof LotteryApiBizError && (code === 2001 || code === 2006)) {
|
||||
void reloadDraw();
|
||||
}
|
||||
toast.error(mapTicketBetError(code, msg, t));
|
||||
} finally {
|
||||
setPreviewLoading(false);
|
||||
@@ -1009,10 +1012,17 @@ export function HallBettingGrid({ drawLive }: { drawLive: HallDrawLiveSnapshot }
|
||||
const traceId = placeTraceIdRef.current ?? newPlaceTraceId();
|
||||
placeTraceIdRef.current = traceId;
|
||||
|
||||
const drawIdForBet =
|
||||
previewData.draw.draw_id.trim() || display.draw_no.trim();
|
||||
if (drawIdForBet === "") {
|
||||
toast.error(t("hall.notBettable"));
|
||||
return;
|
||||
}
|
||||
|
||||
setPlaceLoading(true);
|
||||
try {
|
||||
const data = await postTicketPlace({
|
||||
draw_id: display.draw_no,
|
||||
draw_id: drawIdForBet,
|
||||
currency_code: currencyCode,
|
||||
client_trace_id: traceId,
|
||||
lines,
|
||||
@@ -1067,6 +1077,9 @@ export function HallBettingGrid({ drawLive }: { drawLive: HallDrawLiveSnapshot }
|
||||
setPreviewData(null);
|
||||
clearPlaceTraceId();
|
||||
}
|
||||
if (e instanceof LotteryApiBizError && (code === 2001 || code === 2006)) {
|
||||
void reloadDraw();
|
||||
}
|
||||
toast.error(mapTicketBetError(code, msg, t));
|
||||
} finally {
|
||||
setPlaceLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user