From 9a1ee11a97e20bd3a0bfb49619858d71738f7e0d Mon Sep 17 00:00:00 2001 From: zmeyer44 Date: Wed, 18 Oct 2023 15:05:36 -0400 Subject: [PATCH] auto add self --- app/(app)/(profile)/[npub]/page.tsx | 18 ++----- components/Modals/CreateList.tsx | 2 + lib/actions/create.ts | 79 ----------------------------- lib/actions/zap.ts | 18 +------ 4 files changed, 8 insertions(+), 109 deletions(-) diff --git a/app/(app)/(profile)/[npub]/page.tsx b/app/(app)/(profile)/[npub]/page.tsx index 12c8d46..1837f4e 100644 --- a/app/(app)/(profile)/[npub]/page.tsx +++ b/app/(app)/(profile)/[npub]/page.tsx @@ -10,6 +10,7 @@ import { getTwoLetters, truncateText } from "@/lib/utils"; import ProfileFeed from "./_components/Feed"; import Subscriptions from "./_components/Subscriptions"; import { nip19 } from "nostr-tools"; +import useLists from "@/lib/hooks/useLists"; export default function ProfilePage({ params: { npub }, @@ -19,7 +20,6 @@ export default function ProfilePage({ }; }) { const [activeTab, setActiveTab] = useState("feed"); - console.log("calling with ", npub); if (npub === "service-worker.js") { throw new Error("Invalid list"); } @@ -30,18 +30,8 @@ export default function ProfilePage({ } const pubkey = data.toString(); const { profile } = useProfile(pubkey); + const { init, lists } = useLists(); - const demo = [ - { - id: "1", - title: "BTC Radio", - description: - "BTC Radio is the best fuking show ever. you should sub to it. now", - picture: - "https://assets.whop.com/cdn-cgi/image/width=1080/https://assets.whop.com/images/images/51602.original.png?1693358530", - tags: ["music", "crypto", "art"], - }, - ]; return (
@@ -116,9 +106,9 @@ export default function ProfilePage({
- {demo.map((e) => ( + {/* {[].map((e) => ( - ))} + ))} */}
vu === event.pubkey); - if (selfIndex !== -1) { - console.log("Already there"); - - validUsers[selfIndex] = [ - event.pubkey, - "", - "self", - (unixTimeNowInSeconds() + SECONDS_IN_YEAR).toString(), - ]; - } else { - validUsers.push([ - event.pubkey, - "", - "self", - (unixTimeNowInSeconds() + SECONDS_IN_YEAR).toString(), - ]); + if (selfIndex === -1) { + validUsers.push([event.pubkey, "", "self", "4000000000"]); } console.log("Valid users", validUsers); return createEvent(ndk, {