@smartico/public-api 0.0.261 → 0.0.262

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.
@@ -263,7 +263,7 @@ const SAWBuyInTypeNamed = type => {
263
263
  };
264
264
 
265
265
  class SAWUtils {}
266
- SAWUtils.canPlay = (t, balance) => {
266
+ SAWUtils.canPlay = (t, user) => {
267
267
  if (t === null || t === undefined) {
268
268
  return false;
269
269
  }
@@ -280,6 +280,12 @@ SAWUtils.canPlay = (t, balance) => {
280
280
  case SAWBuyInType.Gems:
281
281
  case SAWBuyInType.Diamonds:
282
282
  {
283
+ let balance = user.ach_points_balance;
284
+ if (t.saw_buyin_type_id === SAWBuyInType.Gems) {
285
+ balance = user.ach_gems_balance;
286
+ } else if (t.saw_buyin_type_id === SAWBuyInType.Diamonds) {
287
+ balance = user.ach_diamonds_balance;
288
+ }
283
289
  return t.buyin_cost_points <= balance;
284
290
  }
285
291
  default: