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),