Skip to content

Commit

Permalink
mmp2p: handle missing verified-mode info after upgrade deadline (open…
Browse files Browse the repository at this point in the history
  • Loading branch information
muselesscreator authored Mar 30, 2021
1 parent 4d1ed0f commit 9dcb91a
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/experiments/mm-p2p/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,16 @@ const initHomeMMP2P = (courseId) => {
if (
accessExpiration !== null
&& accessExpiration !== undefined
&& verifiedMode !== null
&& verifiedMode !== undefined
) {
access.isAudit = true;
access.accessExpirationDate = accessExpiration.expirationDate;
access.upgradeUrl = accessExpiration.upgradeUrl;
access.price = `${verifiedMode.currencySymbol}${verifiedMode.price}`;
if (
verifiedMode !== null
&& verifiedMode !== undefined
) {
access.price = `${verifiedMode.currencySymbol}${verifiedMode.price}`;
}
}

return {
Expand Down Expand Up @@ -186,13 +189,16 @@ const initCoursewareMMP2P = (courseId, sequenceId, unitId) => {
if (
accessExpiration !== null
&& accessExpiration !== undefined
&& verifiedMode !== null
&& verifiedMode !== undefined
) {
access.isAudit = true;
access.accessExpirationDate = accessExpiration.expirationDate;
access.upgradeUrl = accessExpiration.upgradeUrl;
access.price = `${verifiedMode.currencySymbol}${verifiedMode.price}`;
if (
verifiedMode !== null
&& verifiedMode !== undefined
) {
access.price = `${verifiedMode.currencySymbol}${verifiedMode.price}`;
}
}

// testing
Expand Down Expand Up @@ -222,12 +228,14 @@ const initCoursewareMMP2P = (courseId, sequenceId, unitId) => {
);
meta.blockContent = (MMP2POptions.isEnabled && meta.verifiedLock);

return {
const config = {
access,
flyover,
meta,
state: MMP2POptions,
};

return config;
};

export {
Expand Down

0 comments on commit 9dcb91a

Please sign in to comment.