diff --git a/src/components/content/carousels/CoursesCarousel.js b/src/components/content/carousels/CoursesCarousel.js
index dd8e479..6b6c324 100644
--- a/src/components/content/carousels/CoursesCarousel.js
+++ b/src/components/content/carousels/CoursesCarousel.js
@@ -31,9 +31,11 @@ export default function CoursesCarousel() {
const fetch = async () => {
try {
const fetchedCourses = await fetchCourses();
+ console.log('fetchedCourses:', fetchedCourses);
if (fetchedCourses && fetchedCourses.length > 0) {
// First process the courses to be ready for display
const processedCourses = fetchedCourses.map(course => parseEvent(course));
+ console.log('processedCourses:', processedCourses);
// Fetch zaps for all processed courses at once
const allZaps = await fetchZapsForEvents(processedCourses);
diff --git a/src/components/forms/CourseForm.js b/src/components/forms/CourseForm.js
index 0b2c753..9903753 100644
--- a/src/components/forms/CourseForm.js
+++ b/src/components/forms/CourseForm.js
@@ -113,7 +113,7 @@ const CourseForm = () => {
]);
}
- processedLessons.push({ id: lesson.d, noteId: lesson.id });
+ processedLessons.push({ id: lesson?.d });
}
// Step 2: Create and publish course
diff --git a/src/components/zaps/ZapDisplay.js b/src/components/zaps/ZapDisplay.js
index 1c2d62f..d740e18 100644
--- a/src/components/zaps/ZapDisplay.js
+++ b/src/components/zaps/ZapDisplay.js
@@ -11,7 +11,7 @@ const ZapDisplay = ({ zapAmount, event }) => {
op.current.toggle(e)}>
- {zapAmount ? zapAmount : }
+ {zapAmount || zapAmount === 0 ? zapAmount : }
diff --git a/src/hooks/useNostr.js b/src/hooks/useNostr.js
index 23e4939..4fca34a 100644
--- a/src/hooks/useNostr.js
+++ b/src/hooks/useNostr.js
@@ -414,12 +414,13 @@ export function useNostr() {
}, [subscribe]);
const fetchCourses = useCallback(async () => {
- const filter = [{ kinds: [30023], authors: [AUTHOR_PUBKEY] }];
- const hasRequiredTags = (tags) => {
- const hasPlebDevs = tags.some(([tag, value]) => tag === "t" && value === "plebdevs");
- const hasCourse = tags.some(([tag, value]) => tag === "t" && value === "course");
- return hasPlebDevs && hasCourse;
- };
+ const filter = [{ kinds: [30004], authors: [AUTHOR_PUBKEY] }];
+ // Do we need required tags for courses? community instead?
+ // const hasRequiredTags = (tags) => {
+ // const hasPlebDevs = tags.some(([tag, value]) => tag === "t" && value === "plebdevs");
+ // const hasCourse = tags.some(([tag, value]) => tag === "t" && value === "course");
+ // return hasPlebDevs && hasCourse;
+ // };
return new Promise((resolve, reject) => {
let courses = [];
@@ -427,9 +428,10 @@ export function useNostr() {
filter,
{
onevent: (event) => {
- if (hasRequiredTags(event.tags)) {
- courses.push(event);
- }
+ // if (hasRequiredTags(event.tags)) {
+ // courses.push(event);
+ // }
+ courses.push(event);
},
onerror: (error) => {
console.error('Error fetching courses:', error);
diff --git a/src/utils/nostr.js b/src/utils/nostr.js
index 8771f28..d138b8b 100644
--- a/src/utils/nostr.js
+++ b/src/utils/nostr.js
@@ -72,6 +72,11 @@ export const parseEvent = (event) => {
}
});
+ // if published_at is an empty string, then set it to event.created_at
+ if (!eventData.published_at) {
+ eventData.published_at = event.created_at;
+ }
+
return eventData;
};