Fix stream ordering

This commit is contained in:
Kieran 2023-06-22 11:54:19 +01:00
parent 54282e13de
commit db4f72d483
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 3 additions and 2 deletions

View File

@ -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';

View File

@ -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;
}