AA-287 cta events (#177)

This commit is contained in:
Nick
2020-08-12 11:48:46 -04:00
committed by GitHub
parent a131a9f9fb
commit 453f56c7c8
9 changed files with 73 additions and 50 deletions

View File

@@ -13,7 +13,7 @@ import messages from './messages';
import BookmarkButton from '../bookmark/BookmarkButton';
import { useModel } from '../../../generic/model-store';
import PageLoading from '../../../generic/PageLoading';
import { resetDeadlines } from '../../../course-home/data/thunks';
import { processEvent } from '../../../course-home/data/thunks';
import { fetchCourse } from '../../data/thunks';
const LockPaywall = React.lazy(() => import('./lock-paywall'));
@@ -138,8 +138,8 @@ function Unit({
referrerPolicy="origin"
onLoad={() => {
window.onmessage = function (e) {
if (e.data === 'reset_dates') {
dispatch(resetDeadlines(courseId, fetchCourse));
if (e.data.event_name) {
dispatch(processEvent(e.data, fetchCourse));
}
};
}}