From 103286d8a9ec8de87505d57b6ef8e7ce75d624ff Mon Sep 17 00:00:00 2001 From: austinkelsay Date: Fri, 3 Jan 2025 12:05:16 -0600 Subject: [PATCH] Clean up console logs --- src/components/content/lists/ProgressListItem.js | 2 -- src/components/forms/course/PublishedCourseForm.js | 1 - src/components/profile/UserBadges.js | 4 ---- src/hooks/tracking/useTrackVideoLesson.js | 2 -- src/pages/api/auth/[...nextauth].js | 3 --- src/pages/api/badges/issue.js | 3 --- 6 files changed, 15 deletions(-) diff --git a/src/components/content/lists/ProgressListItem.js b/src/components/content/lists/ProgressListItem.js index 3e9cb0f..7aed41d 100644 --- a/src/components/content/lists/ProgressListItem.js +++ b/src/components/content/lists/ProgressListItem.js @@ -20,9 +20,7 @@ const ProgressListItem = ({ dTag, category, type = 'course' }) => { authors: appConfig.authorPubkeys, "#d": [dTag], } - console.log("filter", filter); const event = await ndk.fetchEvent(filter); - console.log("event", event); if (event) { setEvent(type === 'course' ? parseCourseEvent(event) : parseEvent(event)); } diff --git a/src/components/forms/course/PublishedCourseForm.js b/src/components/forms/course/PublishedCourseForm.js index 5df22f8..6f639d7 100644 --- a/src/components/forms/course/PublishedCourseForm.js +++ b/src/components/forms/course/PublishedCourseForm.js @@ -77,7 +77,6 @@ const PublishedCourseForm = ({ course }) => { if (!ndk.signer) { await addSigner(); } - console.log('lessons', lessons); const event = new NDKEvent(ndk); event.kind = course.kind; diff --git a/src/components/profile/UserBadges.js b/src/components/profile/UserBadges.js index 2f9cb82..6a82984 100644 --- a/src/components/profile/UserBadges.js +++ b/src/components/profile/UserBadges.js @@ -23,8 +23,6 @@ const UserBadges = ({ visible, onHide }) => { // todo: add the plebdevs hardcoded badge ids (probably in config?) ids: ["4054a68f028edf38cd1d71cc4693d4ff5c9c54b0b44532361fe6abb29530cbf6", "5d38fea9a3c1fb4c55c9635c3132d34608c91de640f772438faa1942677087a8", "3ba20936d66523adb6d71793649bc77f3cea34f50c21ec7bb2c041f936022214", "41edee5af6d4e833d11f9411c2c27cc48c14d2a3c7966ae7648568e825eda1ed"] }); - - console.log("Badge Definitions: ", badgeDefinitions); // Fetch badge awards (kind 8) using fetchEvents instead of subscribe const badgeAwards = await ndk.fetchEvents({ @@ -61,8 +59,6 @@ const UserBadges = ({ visible, onHide }) => { }) }; - console.log("Current Badge: ", currentBadge); - // Only update if this is the first instance or if it's newer than the existing one if (!latestBadgeMap.has(defId) || new Date(currentBadge.awardedOn) > new Date(latestBadgeMap.get(defId).awardedOn)) { diff --git a/src/hooks/tracking/useTrackVideoLesson.js b/src/hooks/tracking/useTrackVideoLesson.js index 9f86415..33a30ac 100644 --- a/src/hooks/tracking/useTrackVideoLesson.js +++ b/src/hooks/tracking/useTrackVideoLesson.js @@ -81,11 +81,9 @@ const useTrackVideoLesson = ({lessonId, videoDuration, courseId, videoPlayed, pa const alreadyCompleted = await checkOrCreateUserLesson(); if (!alreadyCompleted && videoDuration && !completedRef.current && videoPlayed && (paidCourse === false || (paidCourse && decryptionPerformed))) { setIsTracking(true); - console.log('🎥 Starting video tracking - Duration:', videoDuration); timerRef.current = setInterval(() => { setTimeSpent(prevTime => { const newTime = prevTime + 1; - console.log(`⏱️ Time spent: ${newTime}s / ${videoDuration}s (${((newTime/videoDuration)*100).toFixed(1)}%)`); return newTime; }); }, 1000); diff --git a/src/pages/api/auth/[...nextauth].js b/src/pages/api/auth/[...nextauth].js index 19e87c5..2ed0013 100644 --- a/src/pages/api/auth/[...nextauth].js +++ b/src/pages/api/auth/[...nextauth].js @@ -188,7 +188,6 @@ export const authOptions = { // Update the user with the new keypair const createdUser = await createUser(newUser); - console.log("Created user", createdUser); return createdUser; } else { console.log("User already exists", existingUser); @@ -277,7 +276,6 @@ export const authOptions = { // nostr login (we have no privkey) if (account?.provider === "github" && user?.id && user?.pubkey) { - console.log("GITHUB LOGIN"); try { // First check if there's already a GitHub account linked const existingGithubAccount = await prisma.account.findFirst({ @@ -291,7 +289,6 @@ export const authOptions = { token.githubUsername = profile?.login || profile?.name; if (!existingGithubAccount) { - console.log("No existing GitHub account found"); // Update user profile with GitHub info const updatedUser = await updateUser(user.id, { name: profile?.login || profile?.name, diff --git a/src/pages/api/badges/issue.js b/src/pages/api/badges/issue.js index 77ff30b..a474569 100644 --- a/src/pages/api/badges/issue.js +++ b/src/pages/api/badges/issue.js @@ -128,8 +128,6 @@ export default async function handler(req, res) { // Finalize (sign) the event const signedEvent = finalizeEvent(eventTemplate, signingKeyBytes); - console.log("Signed Event: ", signedEvent); - // Verify the event const isValid = verifyEvent(signedEvent); if (!isValid) { @@ -143,7 +141,6 @@ export default async function handler(req, res) { try { await Promise.any(pool.publish(appConfig.defaultRelayUrls, signedEvent)); published = true; - console.log('Event published to at least one relay'); } catch (error) { throw new Error('Failed to publish to any relay'); } finally {