diff --git a/app/(sharing)/[token]/[id]/page.tsx b/app/(sharing)/[token]/[id]/page.tsx index 31b4506..9198a23 100644 --- a/app/(sharing)/[token]/[id]/page.tsx +++ b/app/(sharing)/[token]/[id]/page.tsx @@ -39,77 +39,74 @@ export default async function Share({ // Filter songsData to match the playlogIds const chunithm: chunithm[] = songsData.filter((song) => - playlogIds.includes(song.id) + playlogIds.includes(song.id), ); return ( -
-
+
+
{chunithm.map((song) => (
- - {song.isNewRecord && "NEW RECORD!!"} - - + Song: {song.title}
))}
-
+
{chunithm.map((song) => (
- + Artist: {song.artist}
))}
-
+
{chunithm.map((song) => (
- + Score: {song.score?.toLocaleString()}
))}
-
+
{chunithm.map((song) => (
- + Rank: {getGrade(song.score ?? 0)}
))}
-
+
{chunithm.map((song) => (
- - {song.isFullCombo && "FULL COMBO"} + + {song.isFullCombo && "FULL COMBO!"} - + Max combo: {song.maxCombo}
))}
-
+
{chunithm.map((song) => (
- + Judge Justice: {song.judgeJustice} - + Judge Attack: {song.judgeAttack} - + Miss: {song.judgeGuilty}
diff --git a/app/(sharing)/[token]/token.ts b/app/(sharing)/[token]/token.ts index c023439..b643764 100644 --- a/app/(sharing)/[token]/token.ts +++ b/app/(sharing)/[token]/token.ts @@ -8,8 +8,8 @@ import { redirect } from "next/navigation"; export async function generateShareToken(id: number): Promise<{ token?: string; - id?: string; - error?: string; + id?: string; + error?: string; }> { const { user } = await getAuth(); @@ -24,10 +24,10 @@ export async function generateShareToken(id: number): Promise<{ // generate token logic const token = await daphnis.linkSharingToken.create({ data: { - playlogId: id, // sets the playlog id - id: randomUUID(), // generates a random primary id for the share token - userId: user.id, // attaches the userid from daphnis - token: gernatetoken, // makes an expirable token thats added to the token column + playlogId: id, // sets the playlog id + id: randomUUID(), // generates a random primary id for the share token + userId: user.id, // attaches the userid from daphnis + token: gernatetoken, // makes an expirable token thats added to the token column createdAt: new Date(), // created at date }, }); @@ -49,21 +49,21 @@ export async function shareScore(token: string) { } // Check if token has expired - const tokenAge = - new Date().getTime() - new Date(PublicPage.createdAt).getTime(); - const tokenAgeLimit = 1000 * 60 * 60 * 24; // 1 day in milliseconds + // const tokenAge = + // new Date().getTime() - new Date(PublicPage.createdAt).getTime(); + // const tokenAgeLimit = 1000 * 60 * 60 * 24; // 1 day in milliseconds - if (tokenAge > tokenAgeLimit) { - await daphnis.linkSharingToken.update({ - where: { - token, - }, - data: { - tokenExpiredAt: new Date(), - }, - }); - redirect("/"); - } + // if (tokenAge > tokenAgeLimit) { + // await daphnis.linkSharingToken.update({ + // where: { + // token, + // }, + // data: { + // tokenExpiredAt: new Date(), + // }, + // }); + // redirect("/"); + // } return { success: true }; } diff --git a/components/scoreplaylog/colums.tsx b/components/scoreplaylog/colums.tsx index f05e7fe..a5a3581 100644 --- a/components/scoreplaylog/colums.tsx +++ b/components/scoreplaylog/colums.tsx @@ -33,14 +33,14 @@ export const columns: ColumnDef[] = [ const jacketPath = row.original.jacketPath?.replace(".dds", ".png"); const [isLoading, setIsLoading] = useState(true); return ( -
+
{!jacketPath ? ( - + ) : ( Jacket )} {row.original.title} @@ -149,10 +149,8 @@ export const columns: ColumnDef[] = [ { id: "actions", - header: () =>
More
, + header: () =>
More
, cell: ({ row }) => { - const song = row.original; - // eslint-disable-next-line react-hooks/rules-of-hooks const [error, setError] = useState(""); // eslint-disable-next-line react-hooks/rules-of-hooks const router = useRouter();