@sunbird-cb/consumption 0.0.101 → 0.0.102
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/bundles/sunbird-cb-consumption.umd.js +8 -1
- package/bundles/sunbird-cb-consumption.umd.js.map +1 -1
- package/bundles/sunbird-cb-consumption.umd.min.js +1 -1
- package/bundles/sunbird-cb-consumption.umd.min.js.map +1 -1
- package/esm2015/lib/_services/widget-content-lib.service.js +25 -20
- package/esm2015/lib/_services/widget-user-lib.service.js +5 -1
- package/esm5/lib/_services/widget-content-lib.service.js +5 -2
- package/esm5/lib/_services/widget-user-lib.service.js +5 -1
- package/fesm2015/sunbird-cb-consumption.js +28 -19
- package/fesm2015/sunbird-cb-consumption.js.map +1 -1
- package/fesm5/sunbird-cb-consumption.js +8 -1
- package/fesm5/sunbird-cb-consumption.js.map +1 -1
- package/lib/_services/widget-user-lib.service.d.ts +1 -0
- package/package.json +1 -1
- package/sunbird-cb-consumption.metadata.json +1 -1
|
@@ -1810,6 +1810,7 @@
|
|
|
1810
1810
|
var WidgetUserServiceLib = /** @class */ (function () {
|
|
1811
1811
|
function WidgetUserServiceLib(environment, http) {
|
|
1812
1812
|
this.http = http;
|
|
1813
|
+
this.enrollmentDataIds = [];
|
|
1813
1814
|
this.environment = environment;
|
|
1814
1815
|
}
|
|
1815
1816
|
/**
|
|
@@ -1889,6 +1890,7 @@
|
|
|
1889
1890
|
if (content.contentStatus) {
|
|
1890
1891
|
delete content.contentStatus;
|
|
1891
1892
|
}
|
|
1893
|
+
_this.enrollmentDataIds.push(content.contentId);
|
|
1892
1894
|
coursesData.push(content);
|
|
1893
1895
|
}));
|
|
1894
1896
|
_this.storeUserEnrollmentInfo(data.result.userCourseEnrolmentInfo, data.result.courses.length);
|
|
@@ -2342,6 +2344,8 @@
|
|
|
2342
2344
|
if (false) {
|
|
2343
2345
|
/** @type {?} */
|
|
2344
2346
|
WidgetUserServiceLib.prototype.environment;
|
|
2347
|
+
/** @type {?} */
|
|
2348
|
+
WidgetUserServiceLib.prototype.enrollmentDataIds;
|
|
2345
2349
|
/**
|
|
2346
2350
|
* @type {?}
|
|
2347
2351
|
* @private
|
|
@@ -3208,12 +3212,14 @@
|
|
|
3208
3212
|
*/
|
|
3209
3213
|
function (doId) {
|
|
3210
3214
|
return __awaiter(this, void 0, void 0, function () {
|
|
3211
|
-
var userId, responseData;
|
|
3215
|
+
var enrolledDoId, userId, responseData;
|
|
3212
3216
|
var _this = this;
|
|
3213
3217
|
return __generator(this, function (_a) {
|
|
3214
3218
|
switch (_a.label) {
|
|
3215
3219
|
case 0:
|
|
3220
|
+
enrolledDoId = this.userSvc.enrollmentDataIds.includes(doId);
|
|
3216
3221
|
userId = this.configSvc.userProfile.userId;
|
|
3222
|
+
if (!enrolledDoId) return [3 /*break*/, 2];
|
|
3217
3223
|
return [4 /*yield*/, this.userSvc.fetchEnrollmentDataByContentId(userId, doId).toPromise().then((/**
|
|
3218
3224
|
* @param {?} res
|
|
3219
3225
|
* @return {?}
|
|
@@ -3238,6 +3244,7 @@
|
|
|
3238
3244
|
case 1:
|
|
3239
3245
|
responseData = _a.sent();
|
|
3240
3246
|
return [2 /*return*/, responseData || []];
|
|
3247
|
+
case 2: return [2 /*return*/, []];
|
|
3241
3248
|
}
|
|
3242
3249
|
});
|
|
3243
3250
|
});
|