From 1afd2781818ef5cba0f018811f12cd8653da10b6 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Thu, 20 Mar 2025 23:28:39 +0900
Subject: fix(frontend): fix state corruption

---
 frontend/app/components/Gaming/RankingTable.tsx | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

(limited to 'frontend/app/components/Gaming/RankingTable.tsx')

diff --git a/frontend/app/components/Gaming/RankingTable.tsx b/frontend/app/components/Gaming/RankingTable.tsx
index e712ed9..a1e41f5 100644
--- a/frontend/app/components/Gaming/RankingTable.tsx
+++ b/frontend/app/components/Gaming/RankingTable.tsx
@@ -1,11 +1,6 @@
+import { useAtomValue } from "jotai";
 import React from "react";
-import type { components } from "../../api/schema";
-
-type RankingEntry = components["schemas"]["RankingEntry"];
-
-type Props = {
-	ranking: RankingEntry[];
-};
+import { rankingAtom } from "../../states/watch";
 
 function TableHeaderCell({ children }: { children: React.ReactNode }) {
 	return (
@@ -33,7 +28,9 @@ function formatUnixTimestamp(timestamp: number) {
 	return `${year}-${month}-${day} ${hours}:${minutes}`;
 }
 
-export default function RankingTable({ ranking }: Props) {
+export default function RankingTable() {
+	const ranking = useAtomValue(rankingAtom);
+
 	return (
 		<div className="overflow-hidden border-2 border-blue-600 rounded-xl">
 			<table className="min-w-full divide-y divide-gray-400 border-collapse">
-- 
cgit v1.2.3-70-g09d2

