mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-19 19:01:19 +00:00
Remove console logs
This commit is contained in:
parent
fda7d50b81
commit
4cc94de801
@ -39,7 +39,7 @@ const CoursePaymentButton = ({ lnAddress, amount, onSuccess, onError, courseId }
|
||||
}
|
||||
}, 2000);
|
||||
} else {
|
||||
console.log('no invoice');
|
||||
console.error('no invoice');
|
||||
}
|
||||
|
||||
return () => {
|
||||
@ -65,10 +65,6 @@ const CoursePaymentButton = ({ lnAddress, amount, onSuccess, onError, courseId }
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log('invoice', invoice);
|
||||
}, [invoice]);
|
||||
|
||||
const handlePaymentSuccess = async (response) => {
|
||||
try {
|
||||
const purchaseData = {
|
||||
|
@ -39,7 +39,7 @@ const ResourcePaymentButton = ({ lnAddress, amount, onSuccess, onError, resource
|
||||
}
|
||||
}, 2000);
|
||||
} else {
|
||||
console.log('no invoice');
|
||||
console.error('no invoice');
|
||||
}
|
||||
|
||||
return () => {
|
||||
@ -66,7 +66,6 @@ const ResourcePaymentButton = ({ lnAddress, amount, onSuccess, onError, resource
|
||||
};
|
||||
|
||||
const handlePaymentSuccess = async (response) => {
|
||||
console.log('handlePaymentSuccess', response);
|
||||
try {
|
||||
const purchaseData = {
|
||||
userId: session.user.id,
|
||||
|
@ -46,7 +46,7 @@ const SubscriptionPaymentButtons = ({ onSuccess, onError, onRecurringSubscriptio
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
console.log('no invoice');
|
||||
console.error('no invoice');
|
||||
}
|
||||
|
||||
return () => {
|
||||
@ -61,7 +61,6 @@ const SubscriptionPaymentButtons = ({ onSuccess, onError, onRecurringSubscriptio
|
||||
const ln = new LightningAddress(lnAddress);
|
||||
await ln.fetch();
|
||||
const newInvoice = await ln.requestInvoice({ satoshi: amount });
|
||||
console.log('newInvoice', newInvoice);
|
||||
return newInvoice;
|
||||
} catch (error) {
|
||||
console.error('Error fetching invoice:', error);
|
||||
@ -72,7 +71,6 @@ const SubscriptionPaymentButtons = ({ onSuccess, onError, onRecurringSubscriptio
|
||||
};
|
||||
|
||||
const handlePaymentSuccess = async (response) => {
|
||||
console.log('Payment successful', response);
|
||||
track('Subscription Payment', { method: "pay_as_you_go", userId: session?.user?.id });
|
||||
showToast('success', 'Payment Successful', 'Your payment has been processed successfully.');
|
||||
if (onSuccess) onSuccess(response);
|
||||
|
@ -47,7 +47,7 @@ export default function DocumentsCarousel() {
|
||||
});
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('err', err);
|
||||
console.error('err', err);
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
@ -36,7 +36,7 @@ export default function GenericCarousel({items, selectedTopic, title}) {
|
||||
});
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('err', err);
|
||||
console.error('err', err);
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
@ -46,7 +46,7 @@ export default function VideosCarousel() {
|
||||
});
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('err', err);
|
||||
console.error('err', err);
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
@ -50,10 +50,6 @@ export default function DraftCourseDetails({ processedEvent, draftId, lessons })
|
||||
}
|
||||
}, [ndk]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('lessons in comp', lessons);
|
||||
}, [lessons]);
|
||||
|
||||
useEffect(() => {
|
||||
if (processedEvent) {
|
||||
fetchAuthor(processedEvent?.user?.pubkey);
|
||||
@ -78,7 +74,6 @@ export default function DraftCourseDetails({ processedEvent, draftId, lessons })
|
||||
}
|
||||
|
||||
const handlePostLesson = async (lesson) => {
|
||||
console.log('lesson in handlePostLesson', lesson);
|
||||
let payload;
|
||||
|
||||
|
||||
@ -99,7 +94,6 @@ export default function DraftCourseDetails({ processedEvent, draftId, lessons })
|
||||
}
|
||||
|
||||
const handlePostResource = async (resource) => {
|
||||
console.log('resourceeeeee:', resource.tags);
|
||||
const dTag = resource.tags.find(tag => tag[0] === 'd')[1];
|
||||
let price
|
||||
|
||||
@ -184,8 +178,6 @@ export default function DraftCourseDetails({ processedEvent, draftId, lessons })
|
||||
}
|
||||
}
|
||||
|
||||
console.log('createdLessons', createdLessons);
|
||||
|
||||
// Step 2: Create and publish course
|
||||
const courseEvent = createCourseEvent(newCourseId, processedEvent.title, processedEvent.summary, processedEvent.image, processedLessons, processedEvent.price);
|
||||
const published = await courseEvent.publish();
|
||||
@ -255,8 +247,6 @@ export default function DraftCourseDetails({ processedEvent, draftId, lessons })
|
||||
let type;
|
||||
let encryptedContent;
|
||||
|
||||
console.log('Draft:', draft);
|
||||
|
||||
switch (draft?.type) {
|
||||
case 'document':
|
||||
if (draft?.price) {
|
||||
@ -360,10 +350,6 @@ export default function DraftCourseDetails({ processedEvent, draftId, lessons })
|
||||
}
|
||||
}, [lessons, user, author, ndk]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('processedLessons', processedLessons);
|
||||
}, [processedLessons]);
|
||||
|
||||
return (
|
||||
<div className='w-full px-24 pt-12 mx-auto mt-4 max-tab:px-0 max-mob:px-0 max-tab:pt-2 max-mob:pt-2'>
|
||||
<div className='w-full flex flex-row justify-between max-tab:flex-col max-mob:flex-col'>
|
||||
|
@ -23,7 +23,6 @@ const DraftCourseLesson = ({ lesson, course }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (lesson?.kind) {
|
||||
console.log(lesson);
|
||||
setIsPublished(true);
|
||||
} else {
|
||||
setIsPublished(false);
|
||||
|
@ -46,7 +46,6 @@ const VideoLesson = ({ lesson, course, decryptionPerformed, isPaid, setCompleted
|
||||
|
||||
try {
|
||||
const data = JSON.parse(event.data);
|
||||
console.log('youtube data', data);
|
||||
if (data.event === "onReady") {
|
||||
event.source.postMessage('{"event":"listening"}', "https://www.youtube.com");
|
||||
} else if (data.event === "infoDelivery" && data?.info && data?.info?.currentTime) {
|
||||
@ -66,18 +65,6 @@ const VideoLesson = ({ lesson, course, decryptionPerformed, isPaid, setCompleted
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (videoDuration && videoPlayed) {
|
||||
console.log('videoDuration and videoPlayed', videoDuration, videoPlayed);
|
||||
}
|
||||
}, [videoDuration, videoPlayed]);
|
||||
|
||||
useEffect(() => {
|
||||
if (videoPlayed) {
|
||||
console.log('videoPlayed', videoPlayed);
|
||||
}
|
||||
}, [videoPlayed]);
|
||||
|
||||
const checkDuration = useCallback(() => {
|
||||
const videoElement = mdDisplayRef.current?.querySelector('video');
|
||||
const youtubeIframe = mdDisplayRef.current?.querySelector('iframe[src*="youtube.com"]');
|
||||
|
@ -46,7 +46,7 @@ const DocumentDetails = ({ processedEvent, topics, title, summary, image, price,
|
||||
setCourse(res.data.lessons[0]?.courseId);
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('err', err);
|
||||
console.error('err', err);
|
||||
});
|
||||
}
|
||||
}, [processedEvent.d, isLesson]);
|
||||
|
@ -37,7 +37,6 @@ const MessageDropdownItem = ({ message, onSelect }) => {
|
||||
const author = await ndk.getUser({ pubkey: message.pubkey });
|
||||
if (author && author?.content) {
|
||||
const authorFields = findKind0Fields(JSON.parse(author.content));
|
||||
console.log("authorFields", authorFields);
|
||||
if (authorFields) {
|
||||
setAuthor(authorFields);
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ const ContentListItem = (content) => {
|
||||
const isDraft = !content?.kind && !content?.draftLessons;
|
||||
|
||||
const handleClick = () => {
|
||||
console.log(content, "isDraftCourse", isDraftCourse, "isDraft", isDraft, "isResource", isResource, "isPublishedCourse", isPublishedCourse);
|
||||
let nAddress;
|
||||
if (isPublishedCourse) {
|
||||
nAddress = nip19.naddrEncode({
|
||||
|
@ -29,7 +29,6 @@ const PurchasedListItem = ({ eventId, category }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (event) {
|
||||
console.log("event", event);
|
||||
encodeNaddr();
|
||||
}
|
||||
}, [event]);
|
||||
|
@ -39,7 +39,7 @@ const VideoDetails = ({ processedEvent, topics, title, summary, image, price, au
|
||||
setCourse(res.data.lessons[0]?.courseId);
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('err', err);
|
||||
console.error('err', err);
|
||||
});
|
||||
}
|
||||
}, [processedEvent.d, isLesson]);
|
||||
|
@ -21,10 +21,6 @@ const StackerNewsFeed = ({ searchQuery }) => {
|
||||
const { data: items, isLoading, error } = useQuery({queryKey: ['stackerNews'], queryFn: fetchStackerNews});
|
||||
const windowWidth = useWindowWidth();
|
||||
|
||||
useEffect(() => {
|
||||
console.log("ot", items);
|
||||
}, [items]);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="h-[100vh] min-bottom-bar:w-[86vw] max-sidebar:w-[100vw]">
|
||||
|
@ -40,11 +40,6 @@ const DocumentForm = ({ draft = null, isPublished = false }) => {
|
||||
const router = useRouter();
|
||||
const { ndk, addSigner } = useNDKContext();
|
||||
|
||||
useEffect(() => {
|
||||
console.log('isPublished', isPublished);
|
||||
console.log('draft', draft);
|
||||
}, [isPublished, draft]);
|
||||
|
||||
useEffect(() => {
|
||||
if (session) {
|
||||
setUser(session.user);
|
||||
@ -109,12 +104,8 @@ const DocumentForm = ({ draft = null, isPublished = false }) => {
|
||||
additionalLinks: additionalLinks.filter(link => link.trim() !== '')
|
||||
}
|
||||
|
||||
console.log('handlePublishedResource', updatedDraft);
|
||||
|
||||
const event = await buildEvent(updatedDraft);
|
||||
|
||||
console.log('event', event);
|
||||
|
||||
try {
|
||||
if (!ndk.signer) {
|
||||
await addSigner();
|
||||
@ -127,7 +118,6 @@ const DocumentForm = ({ draft = null, isPublished = false }) => {
|
||||
if (published) {
|
||||
// update the resource with new noteId
|
||||
const response = await axios.put(`/api/resources/${draft.d}`, { noteId: event.id });
|
||||
console.log('response', response);
|
||||
showToast('success', 'Success', 'Document published successfully.');
|
||||
router.push(`/details/${event.id}`);
|
||||
} else {
|
||||
|
@ -63,7 +63,6 @@ const VideoForm = ({ draft = null }) => {
|
||||
}
|
||||
else if (videoUrl.includes('.mp4') || videoUrl.includes('.mov') || videoUrl.includes('.avi') || videoUrl.includes('.wmv') || videoUrl.includes('.flv') || videoUrl.includes('.webm')) {
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000";
|
||||
console.log("BASE URL", baseUrl);
|
||||
const videoEmbed = `<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;"><video src="${baseUrl}/api/get-video-url?videoKey=${encodeURIComponent(videoUrl)}" style="position:absolute;top:0;left:0;width:100%;height:100%;border:0;" controls></video></div>`;
|
||||
embedCode = videoEmbed;
|
||||
}
|
||||
|
@ -8,10 +8,6 @@ import NostrIcon from '../../../public/images/nostr.png';
|
||||
const CommunityMenuTab = ({ selectedTopic, onTabChange }) => {
|
||||
const allItems = ['global', 'nostr', 'discord', 'stackernews'];
|
||||
|
||||
useEffect(() => {
|
||||
console.log(selectedTopic);
|
||||
}, [selectedTopic]);
|
||||
|
||||
const menuItems = allItems.map((item, index) => {
|
||||
let icon;
|
||||
switch (item) {
|
||||
|
@ -26,7 +26,6 @@ const UserAvatar = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (session) {
|
||||
console.log(session);
|
||||
setUser(session.user);
|
||||
}
|
||||
}, [session]);
|
||||
|
@ -68,8 +68,6 @@ const UserContent = () => {
|
||||
events.forEach(event => {
|
||||
uniqueEvents.add(event);
|
||||
});
|
||||
|
||||
console.log('uniqueEvents', uniqueEvents)
|
||||
return Array.from(uniqueEvents);
|
||||
} catch (error) {
|
||||
console.error('Error fetching videos from NDK:', error);
|
||||
|
@ -66,7 +66,6 @@ const UserSettings = () => {
|
||||
// AUTHENTICATED, // 8
|
||||
// }
|
||||
if (ndk) {
|
||||
console.log("Updating relay statuses");
|
||||
const statuses = {};
|
||||
ndk.pool.relays.forEach((relay, url) => {
|
||||
statuses[url] = relay.connectivity.status === 5;
|
||||
|
@ -48,7 +48,6 @@ const Nip05Form = ({ visible, onHide }) => {
|
||||
update();
|
||||
onHide();
|
||||
} else {
|
||||
console.log("RESPONSE", response);
|
||||
showToast('error', 'Error updating NIP-05', response.data.error);
|
||||
}
|
||||
} catch (error) {
|
||||
|
@ -11,7 +11,6 @@ export const useDecryptContent = () => {
|
||||
|
||||
try {
|
||||
const response = await axios.post('/api/decrypt', { encryptedContent });
|
||||
console.log('response', response);
|
||||
|
||||
if (response.status !== 200) {
|
||||
throw new Error('Failed to decrypt content');
|
||||
|
@ -52,7 +52,6 @@ export function useCommunityNotes() {
|
||||
});
|
||||
|
||||
subscription.on('eose', () => {
|
||||
console.log("eose in useCommunityNotes");
|
||||
setIsLoading(false);
|
||||
});
|
||||
|
||||
|
@ -27,7 +27,6 @@ export function useCourses() {
|
||||
setCoursesError(null);
|
||||
try {
|
||||
if (!contentIds || contentIds.length === 0) {
|
||||
console.log('No content IDs found');
|
||||
setCoursesLoading(false);
|
||||
return []; // Return early if no content IDs are found
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ export function useDocuments() {
|
||||
setDocumentsError(null);
|
||||
try {
|
||||
if (!contentIds || contentIds.length === 0) {
|
||||
console.log('No content IDs found');
|
||||
setDocumentsLoading(false);
|
||||
return []; // Return early if no content IDs are found
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ export function useVideos() {
|
||||
setVideosError(null);
|
||||
try {
|
||||
if (!contentIds || contentIds.length === 0) {
|
||||
console.log('No content IDs found');
|
||||
setVideosLoading(false);
|
||||
return []; // Return early if no content IDs are found
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ export function useAllContentQuery({ids}) {
|
||||
|
||||
const fetchAllContentFromNDK = async (ids) => {
|
||||
try {
|
||||
console.log('Fetching all content from NDK');
|
||||
await ndk.connect();
|
||||
|
||||
const filter = { ids: ids };
|
||||
|
@ -23,7 +23,6 @@ export function useCoursesQuery() {
|
||||
const contentIds = response.data;
|
||||
|
||||
if (!contentIds || contentIds.length === 0) {
|
||||
console.log('No content IDs found');
|
||||
return []; // Return early if no content IDs are found
|
||||
}
|
||||
|
||||
@ -32,8 +31,6 @@ export function useCoursesQuery() {
|
||||
const filter = { kinds: [30004], authors: appConfig.authorPubkeys };
|
||||
const events = await ndk.fetchEvents(filter);
|
||||
|
||||
console.log('events', events);
|
||||
|
||||
if (events && events.size > 0) {
|
||||
const eventsArray = Array.from(events);
|
||||
const courses = eventsArray.filter(event => hasRequiredProperties(event, contentIds));
|
||||
|
@ -24,7 +24,6 @@ export function useDocumentsQuery() {
|
||||
const contentIds = response.data;
|
||||
|
||||
if (!contentIds || contentIds.length === 0) {
|
||||
console.log('No content IDs found');
|
||||
return []; // Return early if no content IDs are found
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ export function useVideosQuery() {
|
||||
const contentIds = response.data;
|
||||
|
||||
if (!contentIds || contentIds.length === 0) {
|
||||
console.log('No content IDs found');
|
||||
return []; // Return early if no content IDs are found
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,6 @@ export function useZapsSubscription({ event }) {
|
||||
})
|
||||
|
||||
subscription.on('eose', () => {
|
||||
console.log("eose in hook")
|
||||
setZapsLoading(false);
|
||||
});
|
||||
|
||||
|
@ -25,7 +25,6 @@ const useCheckCourseProgress = () => {
|
||||
completedAt: new Date().toISOString(),
|
||||
});
|
||||
update()
|
||||
console.log(`Course ${courseId} marked as completed for user ${userId}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Failed to update course ${courseId} completion status:`, error);
|
||||
|
@ -17,9 +17,7 @@ const useTrackCourse = ({courseId, paidCourse, decryptionPerformed}) => {
|
||||
completedRef.current = true;
|
||||
} else if (response.status === 204) {
|
||||
// Only create a new UserCourse entry if it's a free course or if decryption has been performed for a paid course
|
||||
console.log("about to create new UserCourse entry", paidCourse, decryptionPerformed);
|
||||
if (paidCourse === false || (paidCourse && decryptionPerformed)) {
|
||||
console.log("creating new UserCourse entry");
|
||||
await axios.post(`/api/users/${session.user.id}/courses?courseSlug=${courseId}`, {
|
||||
completed: false,
|
||||
started: true,
|
||||
|
@ -80,7 +80,6 @@ const useTrackVideoLesson = ({lessonId, videoDuration, courseId, videoPlayed, pa
|
||||
|
||||
const alreadyCompleted = await checkOrCreateUserLesson();
|
||||
if (!alreadyCompleted && videoDuration && !completedRef.current && videoPlayed && (paidCourse === false || (paidCourse && decryptionPerformed))) {
|
||||
console.log(`Tracking started for lesson ${lessonId}, video duration: ${videoDuration} seconds, video played: ${videoPlayed}`);
|
||||
setIsTracking(true);
|
||||
timerRef.current = setInterval(() => {
|
||||
setTimeSpent(prevTime => prevTime + 1);
|
||||
|
@ -32,7 +32,7 @@ export const useContentSearch = () => {
|
||||
});
|
||||
setAllContent(parsedEvents);
|
||||
} catch (error) {
|
||||
console.log('error', error)
|
||||
console.error('error', error)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,8 +110,6 @@ export default async function handler(req, res) {
|
||||
const pool = new SimplePool();
|
||||
const relays = foundAddress.defaultRelays || appConfig.defaultRelayUrls || [];
|
||||
await Promise.any(pool.publish(relays, signedZapReceipt));
|
||||
|
||||
console.log(`Broadcasted zap receipt for ${name} (${paymentHash})`, zapReceipt);
|
||||
|
||||
// Delete from Redis after successful broadcast
|
||||
await kv.del(key);
|
||||
|
@ -35,8 +35,6 @@ export default async function handler(req, res) {
|
||||
// This is a zap request
|
||||
const zapRequest = JSON.parse(decodeURIComponent(queryParams.nostr));
|
||||
|
||||
console.log("ZAP REQUEST", zapRequest)
|
||||
|
||||
// Verify the zap request
|
||||
if (!verifyEvent(zapRequest)) {
|
||||
res.status(400).json({ error: 'Invalid zap request' });
|
||||
|
@ -63,10 +63,8 @@ export default async function handler(req, res) {
|
||||
|
||||
// If this is a zap, store verification URL and zap request in Redis
|
||||
if (zap_request && foundAddress.allowsNostr) {
|
||||
console.log('Storing zap request in Redis');
|
||||
const zapRequest = JSON.parse(zap_request);
|
||||
const verifyUrl = `${BACKEND_URL}/api/lightning-address/verify/${name}/${paymentHashHex}`;
|
||||
console.log('Verify URL', verifyUrl);
|
||||
|
||||
// Store in Redis
|
||||
await kv.set(`invoice:${paymentHashHex}`, {
|
||||
|
@ -24,8 +24,6 @@ export default async function handler(req, res) {
|
||||
}
|
||||
|
||||
try {
|
||||
console.log('req.body:', req.body);
|
||||
console.log('slug:', slug);
|
||||
const resource = await getResourceById(slug);
|
||||
|
||||
if (!resource) {
|
||||
|
@ -12,10 +12,6 @@ export default function SignIn() {
|
||||
const { data: session, status } = useSession();
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
console.log("session", session)
|
||||
}, [session])
|
||||
|
||||
const handleEmailSignIn = async (e) => {
|
||||
e.preventDefault()
|
||||
await signIn("email", { email, callbackUrl: '/' })
|
||||
@ -54,7 +50,6 @@ export default function SignIn() {
|
||||
if (session?.pubkey && session?.privkey) {
|
||||
localStorage.setItem('anonymousPubkey', session.pubkey)
|
||||
localStorage.setItem('anonymousPrivkey', session.privkey)
|
||||
console.log("Anonymous login successful. Pubkey:", session.pubkey)
|
||||
router.push('/')
|
||||
} else {
|
||||
console.error("Pubkey or privkey not found in session")
|
||||
|
@ -134,8 +134,6 @@ const ContentPage = () => {
|
||||
|
||||
const filterContent = (topic, content) => {
|
||||
let filtered = content;
|
||||
console.log('topic', topic);
|
||||
console.log('content', content);
|
||||
if (topic !== 'All') {
|
||||
const topicLower = topic.toLowerCase();
|
||||
if (['courses', 'videos', 'documents'].includes(topicLower)) {
|
||||
|
@ -73,7 +73,6 @@ const useCourseData = (ndk, fetchAuthor, router) => {
|
||||
const initializeCourse = async () => {
|
||||
setLoading(true);
|
||||
id = await fetchCourseId();
|
||||
console.log('id', id);
|
||||
if (!id) {
|
||||
setLoading(false);
|
||||
return;
|
||||
@ -131,10 +130,6 @@ const useLessons = (ndk, fetchAuthor, lessonIds, pubkey) => {
|
||||
setUniqueLessons(newUniqueLessons);
|
||||
}, [lessons]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('uniqueLessons', uniqueLessons);
|
||||
}, [uniqueLessons]);
|
||||
|
||||
return { lessons, uniqueLessons, setLessons };
|
||||
};
|
||||
|
||||
@ -183,7 +178,6 @@ const Course = () => {
|
||||
const [completedLessons, setCompletedLessons] = useState([]);
|
||||
|
||||
const setCompleted = useCallback((lessonId) => {
|
||||
console.log('setting completed', lessonId);
|
||||
setCompletedLessons(prev => [...prev, lessonId]);
|
||||
}, []);
|
||||
|
||||
@ -198,10 +192,6 @@ const Course = () => {
|
||||
const { lessons, uniqueLessons, setLessons } = useLessons(ndk, fetchAuthor, lessonIds, course?.pubkey);
|
||||
const { decryptionPerformed, loading: decryptionLoading } = useDecryption(session, paidCourse, course, lessons, setLessons);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('lessonIds', lessonIds);
|
||||
}, [lessonIds]);
|
||||
|
||||
useEffect(() => {
|
||||
if (router.isReady) {
|
||||
const { active } = router.query;
|
||||
@ -225,10 +215,8 @@ const Course = () => {
|
||||
};
|
||||
|
||||
const handlePaymentSuccess = async (response) => {
|
||||
console.log("response in handlePaymentSuccess", response);
|
||||
if (response && response?.preimage) {
|
||||
const updated = await update();
|
||||
console.log("session after update", updated);
|
||||
showToast('success', 'Payment Success', 'You have successfully purchased this course');
|
||||
} else {
|
||||
showToast('error', 'Error', 'Failed to purchase course. Please try again.');
|
||||
|
@ -25,7 +25,6 @@ export default function Edit() {
|
||||
|
||||
if (fetchedEvent) {
|
||||
const parsedEvent = parseEvent(fetchedEvent);
|
||||
console.log('parsedEvent:', parsedEvent);
|
||||
setEvent(parsedEvent);
|
||||
} else {
|
||||
showToast('error', 'Error', 'Event not found.');
|
||||
|
@ -32,13 +32,12 @@ const Details = () => {
|
||||
useEffect(() => {
|
||||
axios.get('/api/lessons').then(res => {
|
||||
if (res.data) {
|
||||
console.log("res.data", res.data);
|
||||
res.data.forEach(lesson => {
|
||||
setLessons(prev => [...prev, { resourceId: lesson?.resourceId, courseId: lesson?.courseId || null }]);
|
||||
});
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('err', err);
|
||||
console.error('err', err);
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
@ -24,7 +24,6 @@ const Edit = () => {
|
||||
|
||||
axios.get(`/api/drafts/${slug}`)
|
||||
.then(res => {
|
||||
console.log('res:', res.data);
|
||||
setDraft(res.data);
|
||||
})
|
||||
.catch(err => {
|
||||
|
@ -61,7 +61,6 @@ export default function Draft() {
|
||||
|
||||
axios.get(`/api/drafts/${slug}`)
|
||||
.then(res => {
|
||||
console.log('res:', res.data);
|
||||
setDraft(res.data);
|
||||
})
|
||||
.catch(err => {
|
||||
@ -86,9 +85,6 @@ export default function Draft() {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('unsignedEvent:', unsignedEvent.validate(), unsignedEvent);
|
||||
console.log('unsignedEvent validation:', validationResult);
|
||||
|
||||
if (unsignedEvent) {
|
||||
const published = await unsignedEvent.publish();
|
||||
|
||||
@ -119,7 +115,6 @@ export default function Draft() {
|
||||
};
|
||||
|
||||
const handlePostResource = async (resource, videoId) => {
|
||||
console.log('resourceeeeee:', resource.tags);
|
||||
const dTag = resource.tags.find(tag => tag[0] === 'd')[1];
|
||||
let price
|
||||
|
||||
@ -185,9 +180,6 @@ export default function Draft() {
|
||||
let encryptedContent;
|
||||
let videoId;
|
||||
|
||||
console.log('Draft:', draft);
|
||||
console.log('NewDTag:', NewDTag);
|
||||
|
||||
switch (draft?.type) {
|
||||
case 'document':
|
||||
if (draft?.price) {
|
||||
@ -221,7 +213,6 @@ export default function Draft() {
|
||||
const extractedVideoId = draft.content.split('?videoKey=')[1].split('"')[0];
|
||||
videoId = extractedVideoId;
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000";
|
||||
console.log("BASE URL", baseUrl);
|
||||
const videoEmbed = `<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;"><video src="${baseUrl}/api/get-video-url?videoKey=${encodeURIComponent(extractedVideoId)}" style="position:absolute;top:0;left:0;width:100%;height:100%;border:0;" controls></video></div>`;
|
||||
if (draft?.price) {
|
||||
const encryptedVideoUrl = await encryptContent(videoEmbed);
|
||||
|
@ -1,7 +1,6 @@
|
||||
import {bech32} from 'bech32';
|
||||
|
||||
export const lnurlEncode = (data) => {
|
||||
console.log('data:', data);
|
||||
const words = bech32.toWords(Buffer.from(data, 'utf8'));
|
||||
return bech32.encode("lnurl", words, 2000).toUpperCase()
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user