@selfcommunity/react-core 0.6.7-payments.185 → 0.6.7-payments.187

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.
@@ -60,6 +60,7 @@ function useSCJoinedCoursesManager(user) {
60
60
  * @param dataMsg
61
61
  */
62
62
  const notificationSubscriber = (msg, dataMsg) => {
63
+ var _a;
63
64
  if (dataMsg.data.course !== undefined) {
64
65
  let _status;
65
66
  switch (Notification_1.SCNotificationMapping[dataMsg.data.activity_type]) {
@@ -73,7 +74,12 @@ function useSCJoinedCoursesManager(user) {
73
74
  _status = SCCourseJoinStatusType.JOINED;
74
75
  break; */
75
76
  case types_1.SCNotificationTypologyType.USER_ADDED_TO_COURSE:
76
- _status = types_1.SCCourseJoinStatusType.JOINED;
77
+ if (dataMsg.data.notification_obj.course && ((_a = dataMsg.data.notification_obj.course.paywalls) === null || _a === void 0 ? void 0 : _a.length)) {
78
+ _status = types_1.SCCourseJoinStatusType.PAYMENT_WAITING;
79
+ }
80
+ else {
81
+ _status = types_1.SCCourseJoinStatusType.JOINED;
82
+ }
77
83
  break;
78
84
  }
79
85
  updateCache([dataMsg.data.course]);
@@ -61,6 +61,7 @@ function useSCSubscribedGroupsManager(user) {
61
61
  * @param dataMsg
62
62
  */
63
63
  const notificationSubscriber = (msg, dataMsg) => {
64
+ var _a;
64
65
  if (dataMsg.data.group !== undefined) {
65
66
  let _status;
66
67
  switch (Notification_1.SCNotificationMapping[dataMsg.data.activity_type]) {
@@ -74,7 +75,12 @@ function useSCSubscribedGroupsManager(user) {
74
75
  _status = SCGroupSubscriptionStatusType.SUBSCRIBED;
75
76
  break; */
76
77
  case types_1.SCNotificationTypologyType.USER_ADDED_TO_GROUP:
77
- _status = types_1.SCGroupSubscriptionStatusType.SUBSCRIBED;
78
+ if (dataMsg.data.notification_obj.group && ((_a = dataMsg.data.notification_obj.group.paywalls) === null || _a === void 0 ? void 0 : _a.length)) {
79
+ _status = types_1.SCGroupSubscriptionStatusType.PAYMENT_WAITING;
80
+ }
81
+ else {
82
+ _status = types_1.SCGroupSubscriptionStatusType.SUBSCRIBED;
83
+ }
78
84
  break;
79
85
  }
80
86
  updateCache([dataMsg.data.group]);
@@ -57,6 +57,7 @@ export default function useSCJoinedCoursesManager(user) {
57
57
  * @param dataMsg
58
58
  */
59
59
  const notificationSubscriber = (msg, dataMsg) => {
60
+ var _a;
60
61
  if (dataMsg.data.course !== undefined) {
61
62
  let _status;
62
63
  switch (SCNotificationMapping[dataMsg.data.activity_type]) {
@@ -70,7 +71,12 @@ export default function useSCJoinedCoursesManager(user) {
70
71
  _status = SCCourseJoinStatusType.JOINED;
71
72
  break; */
72
73
  case SCNotificationTypologyType.USER_ADDED_TO_COURSE:
73
- _status = SCCourseJoinStatusType.JOINED;
74
+ if (dataMsg.data.notification_obj.course && ((_a = dataMsg.data.notification_obj.course.paywalls) === null || _a === void 0 ? void 0 : _a.length)) {
75
+ _status = SCCourseJoinStatusType.PAYMENT_WAITING;
76
+ }
77
+ else {
78
+ _status = SCCourseJoinStatusType.JOINED;
79
+ }
74
80
  break;
75
81
  }
76
82
  updateCache([dataMsg.data.course]);
@@ -58,6 +58,7 @@ export default function useSCSubscribedGroupsManager(user) {
58
58
  * @param dataMsg
59
59
  */
60
60
  const notificationSubscriber = (msg, dataMsg) => {
61
+ var _a;
61
62
  if (dataMsg.data.group !== undefined) {
62
63
  let _status;
63
64
  switch (SCNotificationMapping[dataMsg.data.activity_type]) {
@@ -71,7 +72,12 @@ export default function useSCSubscribedGroupsManager(user) {
71
72
  _status = SCGroupSubscriptionStatusType.SUBSCRIBED;
72
73
  break; */
73
74
  case SCNotificationTypologyType.USER_ADDED_TO_GROUP:
74
- _status = SCGroupSubscriptionStatusType.SUBSCRIBED;
75
+ if (dataMsg.data.notification_obj.group && ((_a = dataMsg.data.notification_obj.group.paywalls) === null || _a === void 0 ? void 0 : _a.length)) {
76
+ _status = SCGroupSubscriptionStatusType.PAYMENT_WAITING;
77
+ }
78
+ else {
79
+ _status = SCGroupSubscriptionStatusType.SUBSCRIBED;
80
+ }
75
81
  break;
76
82
  }
77
83
  updateCache([dataMsg.data.group]);