@smartico/public-api 0.0.384 → 0.0.385

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": "@smartico/public-api",
3
- "version": "0.0.384",
3
+ "version": "0.0.385",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -53,6 +53,9 @@ export interface InboxMessage {
53
53
  }
54
54
 
55
55
  export const InboxMessageBodyTransform = (item: InboxMessageBody): TInboxMessageBody => {
56
+ if (!item) {
57
+ return null;
58
+ }
56
59
  const x: TInboxMessageBody = {
57
60
  action: item.action,
58
61
  icon: item.image,
@@ -76,7 +76,7 @@ export interface Tournament {
76
76
 
77
77
  export const TournamentItemsTransform = (items: Tournament[]): TTournament[] => {
78
78
  return items
79
- .filter((r) => r.tournamentId >= 1)
79
+ .filter((r) => r != null && r.tournamentId >= 1)
80
80
  .map((r) => {
81
81
  const x: TTournament = {
82
82
  instance_id: r.tournamentInstanceId,
@@ -121,6 +121,9 @@ export class WSAPIJackpots extends WSAPIClans {
121
121
  ECacheContext.WSAPI,
122
122
  async () => {
123
123
  const _jackpots = await this.api.jackpotGet(this.userExtId, filter);
124
+ if (!_jackpots?.items) {
125
+ return [];
126
+ }
124
127
  const _pots = _jackpots.items.map((jp) => jp.pot);
125
128
 
126
129
  _jackpots.items.forEach((jp) => {
@@ -586,6 +586,9 @@ export class WSAPIMiniGames extends WSAPIRaffles {
586
586
  CACHE_DATA_SEC,
587
587
  );
588
588
  const index = templates.findIndex((t) => t.id === data.saw_template_id);
589
+ if (index === -1) {
590
+ return;
591
+ }
589
592
  templates[index].spin_count = data.spin_count;
590
593
  this.updateEntity(onUpdateContextKey.Saw, templates);
591
594
  }