diff --git a/app/(app)/(profile)/[npub]/page.tsx b/app/(app)/(profile)/[npub]/page.tsx
index 29f3a28..807d82f 100644
--- a/app/(app)/(profile)/[npub]/page.tsx
+++ b/app/(app)/(profile)/[npub]/page.tsx
@@ -18,7 +18,13 @@ export default function ProfilePage({
};
}) {
const [activeTab, setActiveTab] = useState("feed");
- const pubkey = nip19.decode(npub).data.toString();
+ console.log("calling with ", npub);
+ const { type, data } = nip19.decode(npub);
+ console.log("RES", data);
+ if (type !== "npub") {
+ throw new Error("Invalid list");
+ }
+ const pubkey = data.toString();
const { profile } = useProfile(pubkey);
const demo = [
diff --git a/app/(app)/(profile)/layout.tsx b/app/(app)/(profile)/layout.tsx
new file mode 100644
index 0000000..9507d26
--- /dev/null
+++ b/app/(app)/(profile)/layout.tsx
@@ -0,0 +1,15 @@
+import { redirect } from "next/navigation";
+import { nip19 } from "nostr-tools";
+
+export default function Layout(props: {
+ children: React.ReactNode;
+ params: {
+ npub?: string;
+ };
+}) {
+ const key = props.params.npub;
+ if (key === "service-worker.js") {
+ redirect("/");
+ }
+ return props.children;
+}
diff --git a/app/(app)/_layout/Sidebar.tsx b/app/(app)/_layout/Sidebar.tsx
index 2633a2d..d09c499 100644
--- a/app/(app)/_layout/Sidebar.tsx
+++ b/app/(app)/_layout/Sidebar.tsx
@@ -19,10 +19,15 @@ import {
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
-import ZapPicker from "@/components/Modals/ZapPicker";
+import dynamic from "next/dynamic";
import { useModal } from "@/app/_providers/modal/provider";
import { IconType } from "react-icons";
-
+const ZapPickerModal = dynamic(() => import("@/components/Modals/ZapPicker"), {
+ ssr: false,
+});
+const NewEventModal = dynamic(() => import("@/components/Modals/NewEvent"), {
+ ssr: false,
+});
type NavigationLink = {
type: "link";
href: string;
@@ -71,7 +76,7 @@ export default function Sidebar() {
active: false,
},
{
- onClick: () => modal?.show(),
+ onClick: () => modal?.show(),
name: "zap",
label: "Zap Flockstr",
icon: HiOutlineLightningBolt,
@@ -192,14 +197,14 @@ export default function Sidebar() {
})}