From ffa9600302d32201b261ad8c0ece98c2f4f25982 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Tue, 21 Sep 2021 11:50:48 -0400 Subject: [PATCH] active scritp production typo and add new page size --- src/ui/ActiveScripts/ScriptProduction.tsx | 10 +++------- src/ui/ActiveScripts/ServerAccordionContent.tsx | 13 +++---------- src/ui/ActiveScripts/ServerAccordions.tsx | 9 +-------- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/ui/ActiveScripts/ScriptProduction.tsx b/src/ui/ActiveScripts/ScriptProduction.tsx index 78ee774f7..35f2ca130 100644 --- a/src/ui/ActiveScripts/ScriptProduction.tsx +++ b/src/ui/ActiveScripts/ScriptProduction.tsx @@ -4,6 +4,7 @@ */ import * as React from "react"; +import { Money } from "../React/Money"; import { MoneyRate } from "../React/MoneyRate"; import { use } from "../Context"; @@ -40,18 +41,13 @@ export function ScriptProduction(): React.ReactElement { - Total online production of Active scripts: + Total production: - + - - - - Total online production since last Aug installation: - () diff --git a/src/ui/ActiveScripts/ServerAccordionContent.tsx b/src/ui/ActiveScripts/ServerAccordionContent.tsx index e8aef48c1..00ac07b07 100644 --- a/src/ui/ActiveScripts/ServerAccordionContent.tsx +++ b/src/ui/ActiveScripts/ServerAccordionContent.tsx @@ -21,26 +21,19 @@ export function ServerAccordionContent(props: IProps): React.ReactElement { setPage(0); }; - let safePage = page; - while (safePage * rowsPerPage + 1 > props.workerScripts.length) { - safePage--; - } - - if (safePage != page) setPage(safePage); - return ( <> - {props.workerScripts.slice(safePage * rowsPerPage, safePage * rowsPerPage + rowsPerPage).map((ws) => ( + {props.workerScripts.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((ws) => ( ))} !old); - - let safePage = page; - while (safePage * rowsPerPage + 1 >= filtered.length) { - safePage--; - } - - if (safePage != page) setPage(safePage); } useEffect(() => WorkerScriptStartStopEventEmitter.subscribe(rerender)); @@ -108,7 +101,7 @@ export function ServerAccordions(props: IProps): React.ReactElement { })}