From e12ecdfe3340a6659c3e645e2c1215869d47bdc8 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:51:07 -0400 Subject: [PATCH] Fix appeal check --- app/routes/appeals.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/routes/appeals.tsx b/app/routes/appeals.tsx index 83fc5a3..93c590f 100644 --- a/app/routes/appeals.tsx +++ b/app/routes/appeals.tsx @@ -40,11 +40,11 @@ export async function loader({ context }: { context: RequestContext }) { !Boolean(disabled) && !Boolean(await dataKV.get(`blockedappeal_${currentUser.id}`)) && !Boolean( - ( - await dataKV.list({ - prefix: `appeal_${currentUser.id}`, - }) - ).keys.length, + await context.env.D1.prepare( + "SELECT * FROM appeals WHERE open = 1 AND user = ? LIMIT 1;", + ) + .bind(currentUser.id) + .first(), ), can_toggle: currentUser.permissions & (1 << 0) || currentUser.permissions & (1 << 11),