mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-06 18:31:00 +00:00
Clean up console logs
This commit is contained in:
parent
9e4390de1f
commit
103286d8a9
@ -20,9 +20,7 @@ const ProgressListItem = ({ dTag, category, type = 'course' }) => {
|
|||||||
authors: appConfig.authorPubkeys,
|
authors: appConfig.authorPubkeys,
|
||||||
"#d": [dTag],
|
"#d": [dTag],
|
||||||
}
|
}
|
||||||
console.log("filter", filter);
|
|
||||||
const event = await ndk.fetchEvent(filter);
|
const event = await ndk.fetchEvent(filter);
|
||||||
console.log("event", event);
|
|
||||||
if (event) {
|
if (event) {
|
||||||
setEvent(type === 'course' ? parseCourseEvent(event) : parseEvent(event));
|
setEvent(type === 'course' ? parseCourseEvent(event) : parseEvent(event));
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,6 @@ const PublishedCourseForm = ({ course }) => {
|
|||||||
if (!ndk.signer) {
|
if (!ndk.signer) {
|
||||||
await addSigner();
|
await addSigner();
|
||||||
}
|
}
|
||||||
console.log('lessons', lessons);
|
|
||||||
|
|
||||||
const event = new NDKEvent(ndk);
|
const event = new NDKEvent(ndk);
|
||||||
event.kind = course.kind;
|
event.kind = course.kind;
|
||||||
|
@ -24,8 +24,6 @@ const UserBadges = ({ visible, onHide }) => {
|
|||||||
ids: ["4054a68f028edf38cd1d71cc4693d4ff5c9c54b0b44532361fe6abb29530cbf6", "5d38fea9a3c1fb4c55c9635c3132d34608c91de640f772438faa1942677087a8", "3ba20936d66523adb6d71793649bc77f3cea34f50c21ec7bb2c041f936022214", "41edee5af6d4e833d11f9411c2c27cc48c14d2a3c7966ae7648568e825eda1ed"]
|
ids: ["4054a68f028edf38cd1d71cc4693d4ff5c9c54b0b44532361fe6abb29530cbf6", "5d38fea9a3c1fb4c55c9635c3132d34608c91de640f772438faa1942677087a8", "3ba20936d66523adb6d71793649bc77f3cea34f50c21ec7bb2c041f936022214", "41edee5af6d4e833d11f9411c2c27cc48c14d2a3c7966ae7648568e825eda1ed"]
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Badge Definitions: ", badgeDefinitions);
|
|
||||||
|
|
||||||
// Fetch badge awards (kind 8) using fetchEvents instead of subscribe
|
// Fetch badge awards (kind 8) using fetchEvents instead of subscribe
|
||||||
const badgeAwards = await ndk.fetchEvents({
|
const badgeAwards = await ndk.fetchEvents({
|
||||||
kinds: [8],
|
kinds: [8],
|
||||||
@ -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
|
// Only update if this is the first instance or if it's newer than the existing one
|
||||||
if (!latestBadgeMap.has(defId) ||
|
if (!latestBadgeMap.has(defId) ||
|
||||||
new Date(currentBadge.awardedOn) > new Date(latestBadgeMap.get(defId).awardedOn)) {
|
new Date(currentBadge.awardedOn) > new Date(latestBadgeMap.get(defId).awardedOn)) {
|
||||||
|
@ -81,11 +81,9 @@ const useTrackVideoLesson = ({lessonId, videoDuration, courseId, videoPlayed, pa
|
|||||||
const alreadyCompleted = await checkOrCreateUserLesson();
|
const alreadyCompleted = await checkOrCreateUserLesson();
|
||||||
if (!alreadyCompleted && videoDuration && !completedRef.current && videoPlayed && (paidCourse === false || (paidCourse && decryptionPerformed))) {
|
if (!alreadyCompleted && videoDuration && !completedRef.current && videoPlayed && (paidCourse === false || (paidCourse && decryptionPerformed))) {
|
||||||
setIsTracking(true);
|
setIsTracking(true);
|
||||||
console.log('🎥 Starting video tracking - Duration:', videoDuration);
|
|
||||||
timerRef.current = setInterval(() => {
|
timerRef.current = setInterval(() => {
|
||||||
setTimeSpent(prevTime => {
|
setTimeSpent(prevTime => {
|
||||||
const newTime = prevTime + 1;
|
const newTime = prevTime + 1;
|
||||||
console.log(`⏱️ Time spent: ${newTime}s / ${videoDuration}s (${((newTime/videoDuration)*100).toFixed(1)}%)`);
|
|
||||||
return newTime;
|
return newTime;
|
||||||
});
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
@ -188,7 +188,6 @@ export const authOptions = {
|
|||||||
|
|
||||||
// Update the user with the new keypair
|
// Update the user with the new keypair
|
||||||
const createdUser = await createUser(newUser);
|
const createdUser = await createUser(newUser);
|
||||||
console.log("Created user", createdUser);
|
|
||||||
return createdUser;
|
return createdUser;
|
||||||
} else {
|
} else {
|
||||||
console.log("User already exists", existingUser);
|
console.log("User already exists", existingUser);
|
||||||
@ -277,7 +276,6 @@ export const authOptions = {
|
|||||||
|
|
||||||
// nostr login (we have no privkey)
|
// nostr login (we have no privkey)
|
||||||
if (account?.provider === "github" && user?.id && user?.pubkey) {
|
if (account?.provider === "github" && user?.id && user?.pubkey) {
|
||||||
console.log("GITHUB LOGIN");
|
|
||||||
try {
|
try {
|
||||||
// First check if there's already a GitHub account linked
|
// First check if there's already a GitHub account linked
|
||||||
const existingGithubAccount = await prisma.account.findFirst({
|
const existingGithubAccount = await prisma.account.findFirst({
|
||||||
@ -291,7 +289,6 @@ export const authOptions = {
|
|||||||
token.githubUsername = profile?.login || profile?.name;
|
token.githubUsername = profile?.login || profile?.name;
|
||||||
|
|
||||||
if (!existingGithubAccount) {
|
if (!existingGithubAccount) {
|
||||||
console.log("No existing GitHub account found");
|
|
||||||
// Update user profile with GitHub info
|
// Update user profile with GitHub info
|
||||||
const updatedUser = await updateUser(user.id, {
|
const updatedUser = await updateUser(user.id, {
|
||||||
name: profile?.login || profile?.name,
|
name: profile?.login || profile?.name,
|
||||||
|
@ -128,8 +128,6 @@ export default async function handler(req, res) {
|
|||||||
// Finalize (sign) the event
|
// Finalize (sign) the event
|
||||||
const signedEvent = finalizeEvent(eventTemplate, signingKeyBytes);
|
const signedEvent = finalizeEvent(eventTemplate, signingKeyBytes);
|
||||||
|
|
||||||
console.log("Signed Event: ", signedEvent);
|
|
||||||
|
|
||||||
// Verify the event
|
// Verify the event
|
||||||
const isValid = verifyEvent(signedEvent);
|
const isValid = verifyEvent(signedEvent);
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
@ -143,7 +141,6 @@ export default async function handler(req, res) {
|
|||||||
try {
|
try {
|
||||||
await Promise.any(pool.publish(appConfig.defaultRelayUrls, signedEvent));
|
await Promise.any(pool.publish(appConfig.defaultRelayUrls, signedEvent));
|
||||||
published = true;
|
published = true;
|
||||||
console.log('Event published to at least one relay');
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error('Failed to publish to any relay');
|
throw new Error('Failed to publish to any relay');
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user