fix cache + liniting issue

master
TZGyn 1 year ago
parent 09a307f8d6
commit 55d24c5faf

@ -9,16 +9,17 @@ import {
CardContent, CardContent,
CardFooter, CardFooter,
CardHeader, CardHeader,
CardTitle,
} from "@/components/ui/card"; } from "@/components/ui/card";
export const dynamic = "force-dynamic";
export default async function Home() { export default async function Home() {
const file = await fs.promises.readFile("./output.txt"); const file = await fs.promises.readFile("./output.txt");
const lines = file.toString().split("\n"); const lines = file.toString().split("\n");
const data = lines.map((line) => { const data = lines.map((line) => {
const [timestamp, _, value] = line.split(","); const [timestamp, , value] = line.split(",");
return { return {
timestamp: Math.round(parseFloat(timestamp) * 1000), timestamp: Math.round(parseFloat(timestamp) * 1000),
foldtime: parseFloat(value), foldtime: parseFloat(value),
@ -35,7 +36,7 @@ export default async function Home() {
<div className="flex flex-col gap-2 items-start p-4"> <div className="flex flex-col gap-2 items-start p-4">
<span className="text-muted-foreground">This Month</span> <span className="text-muted-foreground">This Month</span>
<h2 className="text-2xl font-bold"> <h2 className="text-2xl font-bold">
{thisMonthData.reduce((acc, curr) => { {thisMonthData.reduce((acc) => {
return acc + 1; return acc + 1;
}, 0)} }, 0)}
{" Towel(s)"} {" Towel(s)"}
@ -50,7 +51,7 @@ export default async function Home() {
<div className="flex flex-col gap-2 items-start p-4"> <div className="flex flex-col gap-2 items-start p-4">
<span className="text-muted-foreground">Today</span> <span className="text-muted-foreground">Today</span>
<h2 className="text-2xl font-bold"> <h2 className="text-2xl font-bold">
{todayData.reduce((acc, curr) => { {todayData.reduce((acc) => {
return acc + 1; return acc + 1;
}, 0)} }, 0)}
{" Towel(s)"} {" Towel(s)"}
@ -65,7 +66,7 @@ export default async function Home() {
<div className="flex flex-col gap-2 items-start p-4"> <div className="flex flex-col gap-2 items-start p-4">
<span className="text-muted-foreground">This Month</span> <span className="text-muted-foreground">This Month</span>
<h2 className="text-2xl font-bold"> <h2 className="text-2xl font-bold">
{thisMonthData.reduce((acc, curr) => { {thisMonthData.reduce((acc) => {
return acc + 1; return acc + 1;
}, 0)} }, 0)}
{" Towel(s)"} {" Towel(s)"}

Loading…
Cancel
Save