From db4f72d4839ade4a227efa9871061a787ef304cc Mon Sep 17 00:00:00 2001 From: Kieran Date: Thu, 22 Jun 2023 11:54:19 +0100 Subject: [PATCH] Fix stream ordering --- src/index.tsx | 3 ++- src/pages/root.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 658ee0d..504774b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3,8 +3,9 @@ import './index.css'; import React from 'react'; import ReactDOM from 'react-dom/client'; import { NostrSystem } from "@snort/system"; -import { RootPage } from './pages/root'; import { RouterProvider, createBrowserRouter } from 'react-router-dom'; + +import { RootPage } from './pages/root'; import { LayoutPage } from 'pages/layout'; import { StreamPage } from 'pages/stream-page'; import { ChatPopout } from 'pages/chat-popout'; diff --git a/src/pages/root.tsx b/src/pages/root.tsx index 02deba3..065cf7b 100644 --- a/src/pages/root.tsx +++ b/src/pages/root.tsx @@ -19,7 +19,7 @@ export function RootPage() { const aStatus = findTag(a, "status")!; const bStatus = findTag(b, "status")!; if (aStatus === bStatus) { - return b.created_at - a.created_at; + return b.created_at > a.created_at ? 1 : -1; } else { return aStatus === "live" ? -1 : 1; }