@ludo.ninja/components 2.1.16 → 2.1.18

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.
@@ -67,13 +67,14 @@ const Subscription = () => {
67
67
  }));
68
68
  const userId = user?.userId || "";
69
69
  (0, client_1.useSubscription)(api_1.notificationsSchema.OnNotificationDocument, {
70
- variables: { authToken },
70
+ variables: { authToken, notificationTypes: [api_1.notificationsSchema.INotificationType.Push] },
71
71
  onData: (options) => {
72
72
  const notification = options.data.data?.onNotification;
73
- console.log("notification", notification);
73
+ // console.log("notification", notification);
74
74
  if (notification) {
75
- switch (notification.notificationType) {
76
- case "user_opportunity":
75
+ switch (notification.eventType) {
76
+ case api_1.notificationsSchema.IEventType.CommonOpportunity:
77
+ case api_1.notificationsSchema.IEventType.UserOpportunity:
77
78
  addNotification({
78
79
  icon: (0, jsx_runtime_1.jsx)(ImageNotification, { src: notification.media || "", title: notification.name || "Opportunity updated", fallbackSvg: (0, jsx_runtime_1.jsx)(OpportunitySvg_1.OpportunitySvg, {}) }),
79
80
  title: notification.name || "Opportunity updated",
@@ -85,7 +86,7 @@ const Subscription = () => {
85
86
  },
86
87
  });
87
88
  break;
88
- case "user_invitee":
89
+ case api_1.notificationsSchema.IEventType.UserInvitee:
89
90
  addNotification({
90
91
  icon: (0, jsx_runtime_1.jsx)(ImageNotification, { src: notification.media || "", title: notification.name || "Invite code used", fallbackSvg: (0, jsx_runtime_1.jsx)(InviteCodeSvg_1.InviteCodeSvg, {}) }),
91
92
  title: notification.name || "Invite code used",
@@ -101,8 +102,8 @@ const Subscription = () => {
101
102
  },
102
103
  });
103
104
  break;
104
- case "user_xp_increment":
105
- case "user_xps":
105
+ case api_1.notificationsSchema.IEventType.UserXpIncrement:
106
+ case api_1.notificationsSchema.IEventType.UserXps:
106
107
  addNotification({
107
108
  icon: (0, jsx_runtime_1.jsx)(ImageNotification, { src: notification.media || "", title: notification.name || "XP updated", fallbackSvg: (0, jsx_runtime_1.jsx)(XPIconSvg_1.XpIconSvg, {}) }),
108
109
  title: notification.name || "XP updated",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.1.16",
3
+ "version": "2.1.18",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",