diff --git a/src/components/error-boundary.tsx b/src/components/error-boundary.tsx index f4b8b856c..e40d1ff65 100644 --- a/src/components/error-boundary.tsx +++ b/src/components/error-boundary.tsx @@ -1,19 +1,24 @@ import React, { memo } from "react"; import { ErrorBoundary as ErrorBoundaryHelper, FallbackProps } from "react-error-boundary"; import { Alert, AlertIcon, AlertTitle, AlertDescription } from "@chakra-ui/react"; +import { NostrEvent } from "nostr-tools"; +import DebugEventButton from "./debug-modal/debug-event-button"; -export function ErrorFallback({ error, resetErrorBoundary }: Partial) { +export function ErrorFallback({ error, event, resetErrorBoundary }: Partial & { event?: NostrEvent }) { return ( Something went wrong {error?.message} + {event && } ); } -export const ErrorBoundary = memo(({ children, ...props }: { children: React.ReactNode }) => ( - - {children} - -)); +export const ErrorBoundary = memo( + ({ children, event, ...props }: { children: React.ReactNode; event?: NostrEvent }) => ( + } {...props}> + {children} + + ), +); diff --git a/src/components/timeline-page/generic-note-timeline/timeline-item.tsx b/src/components/timeline-page/generic-note-timeline/timeline-item.tsx index 6c7185e74..f4662ac20 100644 --- a/src/components/timeline-page/generic-note-timeline/timeline-item.tsx +++ b/src/components/timeline-page/generic-note-timeline/timeline-item.tsx @@ -46,7 +46,7 @@ function TimelineItem({ event, visible, minHeight }: { event: NostrEvent; visibl } return ( - + {visible && content} diff --git a/src/views/communities/index.tsx b/src/views/communities/index.tsx index 972c4d8cf..a11023a2d 100644 --- a/src/views/communities/index.tsx +++ b/src/views/communities/index.tsx @@ -157,7 +157,7 @@ function CommunitiesHomePage() { Joined Communities {communities.map((community) => ( - + ))} @@ -187,7 +187,7 @@ function CommunitiesHomePage() { {communities.map((community) => ( - + ))} diff --git a/src/views/files/index.tsx b/src/views/files/index.tsx index 5bccb60ad..b848f86ea 100644 --- a/src/views/files/index.tsx +++ b/src/views/files/index.tsx @@ -132,8 +132,8 @@ function FilesPage() { {events.map((event) => ( - - + + ))} diff --git a/src/views/goals/browse.tsx b/src/views/goals/browse.tsx index ec515ef6f..7c9684a20 100644 --- a/src/views/goals/browse.tsx +++ b/src/views/goals/browse.tsx @@ -51,7 +51,7 @@ function GoalsBrowsePage() { {goals.map((event) => ( - + ))} diff --git a/src/views/launchpad/components/notifications-card.tsx b/src/views/launchpad/components/notifications-card.tsx index 8821bdd2b..39a8171ca 100644 --- a/src/views/launchpad/components/notifications-card.tsx +++ b/src/views/launchpad/components/notifications-card.tsx @@ -44,7 +44,7 @@ export default function NotificationsCard({ ...props }: Omit {limit.map((event) => ( - + ))} diff --git a/src/views/launchpad/components/streams-card.tsx b/src/views/launchpad/components/streams-card.tsx index fac304781..e0be904f7 100644 --- a/src/views/launchpad/components/streams-card.tsx +++ b/src/views/launchpad/components/streams-card.tsx @@ -76,7 +76,7 @@ function StreamsCardContent({ ...props }: Omit) { {streams.map((stream) => ( - + ))} diff --git a/src/views/map/timeline.tsx b/src/views/map/timeline.tsx index c3885d25f..6d3760783 100644 --- a/src/views/map/timeline.tsx +++ b/src/views/map/timeline.tsx @@ -26,7 +26,7 @@ const MapTimeline = React.memo(({ timeline, focused }: { timeline: TimelineLoade return ( <> {events.map((event) => ( - + ))} diff --git a/src/views/relays/index-old.tsx b/src/views/relays/index-old.tsx index ac20c26e8..d76f5a469 100644 --- a/src/views/relays/index-old.tsx +++ b/src/views/relays/index-old.tsx @@ -64,8 +64,8 @@ export default function RelaysView() { {filteredRelays.map((url) => ( - - + + ))} @@ -77,8 +77,8 @@ export default function RelaysView() { {discoveredRelays.map((url) => ( - - + + ))} diff --git a/src/views/settings/index.tsx b/src/views/settings/index.tsx index ffd1e11b1..35e65309f 100644 --- a/src/views/settings/index.tsx +++ b/src/views/settings/index.tsx @@ -86,55 +86,3 @@ export default function SettingsView() { ); } - -// export default function SettingsView() { -// const toast = useToast(); -// const { updateSettings, ...settings } = useAppSettings(); - -// const form = useForm({ -// mode: "all", -// values: settings, -// resetOptions: { -// keepDirty: true, -// }, -// }); - -// const saveSettings = form.handleSubmit(async (values) => { -// try { -// await updateSettings(values); -// toast({ title: "Settings saved", status: "success" }); -// } catch (e) { -// if (e instanceof Error) toast({ description: e.message, status: "error" }); -// } -// }); - -// return ( -// -// -// -// -// -// -// -// -// -// -// -// -// -// Github -// -// -// -// -// -// ); -// } diff --git a/src/views/tools/dm-timeline.tsx b/src/views/tools/dm-timeline.tsx index d0e4b8567..daed726cf 100644 --- a/src/views/tools/dm-timeline.tsx +++ b/src/views/tools/dm-timeline.tsx @@ -69,7 +69,7 @@ export function DMTimelinePage() { {dms.map((dm) => ( - + ))} diff --git a/src/views/user/articles.tsx b/src/views/user/articles.tsx index 269454d18..00fbb5510 100644 --- a/src/views/user/articles.tsx +++ b/src/views/user/articles.tsx @@ -9,6 +9,7 @@ import { useTimelineCurserIntersectionCallback } from "../../hooks/use-timeline- import TimelineActionAndStatus from "../../components/timeline/timeline-action-and-status"; import VerticalPageLayout from "../../components/vertical-page-layout"; import ArticleCard from "../articles/components/article-card"; +import { ErrorBoundary } from "../../components/error-boundary"; export default function UserArticlesTab() { const { pubkey } = useOutletContext() as { pubkey: string }; @@ -26,7 +27,9 @@ export default function UserArticlesTab() { {articles.map((article) => ( - + + + ))} diff --git a/src/views/user/following.tsx b/src/views/user/following.tsx index 99d6a8088..9f2454b19 100644 --- a/src/views/user/following.tsx +++ b/src/views/user/following.tsx @@ -23,8 +23,8 @@ export default function UserFollowingTab() { return ( {sorted.map(({ pubkey, relay }) => ( - - + + ))} diff --git a/src/views/user/relays.tsx b/src/views/user/relays.tsx index 7b3393d15..fca6329dd 100644 --- a/src/views/user/relays.tsx +++ b/src/views/user/relays.tsx @@ -82,8 +82,8 @@ const UserRelaysTab = () => { } py="2" align="stretch"> {Array.from(mailboxes?.inboxes ?? []).map((url) => ( - - + + ))} @@ -92,8 +92,8 @@ const UserRelaysTab = () => { } py="2" align="stretch"> {Array.from(mailboxes?.outboxes ?? []).map((url) => ( - - + + ))} diff --git a/src/views/user/zaps.tsx b/src/views/user/zaps.tsx index bbbeeca73..fa931bd28 100644 --- a/src/views/user/zaps.tsx +++ b/src/views/user/zaps.tsx @@ -122,7 +122,7 @@ const UserZapsTab = () => { )} {events.map((event) => ( - + ))} diff --git a/src/views/videos/index.tsx b/src/views/videos/index.tsx index 0674178d2..d8a5d4277 100644 --- a/src/views/videos/index.tsx +++ b/src/views/videos/index.tsx @@ -34,8 +34,8 @@ function VideosPage() { {videos.map((video) => ( - - + + ))}