@dubsdotapp/expo 0.5.29 → 0.5.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dubsdotapp/expo",
3
- "version": "0.5.29",
3
+ "version": "0.5.30",
4
4
  "description": "React Native SDK for the Dubs betting platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -167,19 +167,26 @@ export function JoinGameSheet({
167
167
  const homeBetsCount = bettors.filter(b => b.team === 'home').length;
168
168
  const awayBetsCount = bettors.filter(b => b.team === 'away').length;
169
169
  const drawBetsCount = bettors.filter(b => b.team === 'draw').length;
170
+ // Show comparable odds for every side by computing each as "if I bet
171
+ // `wager` on this team". Total pool grows by `wager` regardless of
172
+ // which side you pick, so newPool is constant; only the side pool
173
+ // shifts. Previously this only added `wager` to the *selected* side,
174
+ // which left an unbetted side with sidePool === 0 → odds shown as
175
+ // "—". Empty sides now show their (high) implied multiplier so the
176
+ // user can actually compare risk/return before committing.
170
177
  const newPool = totalPool + wager;
171
- const newHome = homePool + (selectedTeam === 'home' ? wager : 0);
172
- const newAway = awayPool + (selectedTeam === 'away' ? wager : 0);
173
- const newDraw = drawPool + (selectedTeam === 'draw' ? wager : 0);
178
+ const homeWith = homePool + wager;
179
+ const awayWith = awayPool + wager;
180
+ const drawWith = drawPool + wager;
174
181
  return {
175
- homeOdds: newHome > 0 ? (newPool / newHome).toFixed(2) : '—',
176
- awayOdds: newAway > 0 ? (newPool / newAway).toFixed(2) : '—',
177
- drawOdds: newDraw > 0 ? (newPool / newDraw).toFixed(2) : '—',
182
+ homeOdds: homeWith > 0 ? (newPool / homeWith).toFixed(2) : '—',
183
+ awayOdds: awayWith > 0 ? (newPool / awayWith).toFixed(2) : '—',
184
+ drawOdds: drawWith > 0 ? (newPool / drawWith).toFixed(2) : '—',
178
185
  homeBets: homeBetsCount,
179
186
  awayBets: awayBetsCount,
180
187
  drawBets: drawBetsCount,
181
188
  };
182
- }, [totalPool, homePool, awayPool, drawPool, bettors, wager, selectedTeam]);
189
+ }, [totalPool, homePool, awayPool, drawPool, bettors, wager]);
183
190
 
184
191
  const selectedOdds = selectedTeam === 'home' ? homeOdds : selectedTeam === 'away' ? awayOdds : selectedTeam === 'draw' ? drawOdds : '—';
185
192
  const potentialWinnings = selectedOdds !== '—' ? formatSol(parseFloat(selectedOdds) * wager) : '—';