mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix(wheel): stop showing fake wins in the browser
After a Stars payment the wheel matched its landing sector to the won prize by display_name/emoji and, on any miss, span to Math.random()*360 — which often pointed at a winning slot. The poll result also carried the SPIN id in prize_id (not the WheelPrize id), so it never matched and always hit that random fallback. In a backgrounded browser tab the poll often times out, so the wheel 'landed' on месяц/50₽ while the real result was Ничего; the Mini App was fine because it gets the result inline. - Match the sector by prize_id (exact), with name/emoji only as a defensive fallback for old payloads. - Never land on a random angle: when the prize can't be resolved (poll timeout/error) land on the neutral 'Nothing' sector instead. - Carry the real WheelPrize id (now exposed by the bot history endpoint) through the poll result.
This commit is contained in:
@@ -60,6 +60,9 @@ export interface SpinResult {
|
||||
|
||||
export interface SpinHistoryItem {
|
||||
id: number;
|
||||
// WheelPrize id of the won prize (null if that prize was later deleted). Used to
|
||||
// land the wheel animation on the exact winning sector after a Stars payment.
|
||||
prize_id: number | null;
|
||||
payment_type: string;
|
||||
payment_amount: number;
|
||||
prize_type: string;
|
||||
|
||||
Reference in New Issue
Block a user