diff --git a/src/components/GridView/index.tsx b/src/components/GridView/index.tsx index 69f5adb..b7dae92 100644 --- a/src/components/GridView/index.tsx +++ b/src/components/GridView/index.tsx @@ -16,7 +16,7 @@ const GridView = ({ settings, images }: GridViewProps) => { () => images .filter(i => !isVideo(i.url)) // TODO: filter out video for now, since we don't have a good way to display them - .sort((a, b) => b.timestamp - a.timestamp), // sort by timestamp descending + .sort((a, b) => (b.timestamp && a.timestamp ? b.timestamp - a.timestamp : 0)), // sort by timestamp descending [images] ); diff --git a/src/components/nostrImageDownload.ts b/src/components/nostrImageDownload.ts index 80f9597..643f101 100644 --- a/src/components/nostrImageDownload.ts +++ b/src/components/nostrImageDownload.ts @@ -7,7 +7,7 @@ export type NostrImage = { author: string; tags: string[]; content?: string; - timestamp: number; + timestamp?: number; noteId: string; type: 'image' | 'video'; };