- Last Updated: {format($counter_store.last_updated, "MM/dd 'at' hh:mm a")} by - {$counter_store.resolved_username} -
- {#if didError} -{error}
- {/if} - {#if isAuthed} - - {/if} ++ Last Updated: {format($counter_store.last_updated, "MM/dd 'at' hh:mm a")} by + {$counter_store.resolved_username} +
+ {#if didError} +{error}
+ {/if} + {#if isAuthed} + + {/if}- Quarter Total: {$leaderboard_store[quarter].total} -
-+ Quarter Total: {$leaderboard_store[quarter].total} +
+No players have been added to the leaderboard yet.
+No players have been added to the leaderboard yet.
{/if} diff --git a/src/lib/db/counter.ts b/src/lib/db/counter.ts new file mode 100644 index 0000000..4d5f30c --- /dev/null +++ b/src/lib/db/counter.ts @@ -0,0 +1,69 @@ +import { eq, sql } from "drizzle-orm"; +import { Womps } from "./schema"; +import { getDB } from "./drizzle"; +import type { ENV } from "../../app"; + +async function resolveUsernameFromId(id: number, kv: KVNamespace) { + // resolve the async promise inline + const username = await kv.getMaintenance Mode
- -