From fbe06a623d5e820d5736edf6949b5553c0b54cd6 Mon Sep 17 00:00:00 2001 From: Florian Maul Date: Fri, 28 Jul 2023 18:09:38 +0200 Subject: [PATCH] chore: refactoring --- src/components/GridView/index.tsx | 2 +- src/components/nostrImageDownload.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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'; };