fix condition in course tracking hook

This commit is contained in:
austinkelsay 2025-01-03 15:47:46 -06:00
parent 5476898b70
commit 9213982125
No known key found for this signature in database
GPG Key ID: 44CB4EC6D9F2FA02

View File

@ -30,7 +30,7 @@ const useTrackCourse = ({courseId, paidCourse, decryptionPerformed}) => {
decryptionPerformed
});
if (paidCourse === false || (paidCourse && decryptionPerformed)) {
if (!paidCourse || (paidCourse && decryptionPerformed)) {
console.log('📝 [useTrackCourse] Creating new course entry');
await axios.post(`/api/users/${session.user.id}/courses?courseSlug=${courseId}`, {
completed: false,