@smartico/public-api 0.0.296 → 0.0.298

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.
@@ -6,6 +6,10 @@ interface RafflePrizePublicMeta {
6
6
  description: string;
7
7
  /** URL of the image that represents the prize */
8
8
  image_url: string;
9
+ /**
10
+ * Indicates whether the chance to win should be hidden in the UI.
11
+ */
12
+ hide_chance_to_win: boolean;
9
13
  }
10
14
  /**
11
15
  * Represents a prize in a draw.
@@ -29,6 +29,7 @@ interface Tracker {
29
29
  userPublicProps: any;
30
30
  on: (callBackKey: ClassId, func: (data: any) => void) => void;
31
31
  getLabelSetting: (key: PublicLabelSettings) => any;
32
+ triggerExternalCallBack: (callBackKey: string, payload: any) => void;
32
33
  }
33
34
  interface IOptions {
34
35
  logger?: ILogger;
package/dist/index.js CHANGED
@@ -1909,6 +1909,7 @@ var WSAPI = /*#__PURE__*/function () {
1909
1909
  OCache.clearAll();
1910
1910
  if (this.api.tracker) {
1911
1911
  var on = this.api.tracker.on;
1912
+ var triggerExternalCallback = this.api.tracker.triggerExternalCallBack;
1912
1913
  on(exports.ClassId.SAW_SPINS_COUNT_PUSH, function (data) {
1913
1914
  return _this.updateOnSpin(data);
1914
1915
  });
@@ -1968,6 +1969,15 @@ var WSAPI = /*#__PURE__*/function () {
1968
1969
  _this.updateRaffles();
1969
1970
  OCache.clear(exports.ECacheContext.WSAPI, onUpdateContextKey.Raffles);
1970
1971
  });
1972
+ on(exports.ClassId.GET_INBOX_MESSAGES_RESPONSE, function (res) {
1973
+ var _this$api$tracker;
1974
+ var unreadCountInProfile = (_this$api$tracker = _this.api.tracker) == null || (_this$api$tracker = _this$api$tracker.userPublicProps) == null ? void 0 : _this$api$tracker.core_inbox_unread_count;
1975
+ if (res.unread_count && triggerExternalCallback && unreadCountInProfile !== res.unread_count) {
1976
+ triggerExternalCallback('props_change', {
1977
+ core_inbox_unread_count: res.unread_count
1978
+ });
1979
+ }
1980
+ });
1971
1981
  }
1972
1982
  }
1973
1983
  /** @private */