fixed limit
This commit is contained in:
parent
157e4768f3
commit
10c64268c8
|
|
@ -33,6 +33,7 @@ export const removeGems = async (
|
|||
gems: number,
|
||||
) => {
|
||||
const { count, totalCount } = await getGems(db, user);
|
||||
if (count - gems < 0) throw new Error("Not enough gems");
|
||||
await db
|
||||
.update(Gems)
|
||||
.set({ count: count - gems, totalCount: totalCount - gems })
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ interface LeaderboardButtonProps {
|
|||
const LeaderboardButton = ({
|
||||
label = "View Full Leaderboard",
|
||||
}: LeaderboardButtonProps) => {
|
||||
const { data: leaderboard } = useWSQuery("scoreboard.getScoreBoard", 10);
|
||||
const { data: leaderboard } = useWSQuery("scoreboard.getScoreBoard", 100);
|
||||
return (
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ const Collection = () => {
|
|||
(e) => e.id === theme.id && e.selected,
|
||||
);
|
||||
const owned = collection?.entries.some((e) => e.id === theme.id);
|
||||
const times =
|
||||
collection?.entries.filter((e) => e.id === theme.id).length || 0;
|
||||
if (!owned) return null;
|
||||
return (
|
||||
<div key={theme.id}>
|
||||
|
|
@ -36,7 +38,10 @@ const Collection = () => {
|
|||
<h3 className="text-white/90 text-lg">
|
||||
{theme.name}
|
||||
{owned && (
|
||||
<span className="text-white/70 text-sm"> (Owned)</span>
|
||||
<span className="text-white/70 text-sm">
|
||||
{" "}
|
||||
(Owned{times > 1 && ` ${times}x`})
|
||||
</span>
|
||||
)}
|
||||
</h3>
|
||||
{owned && (
|
||||
|
|
|
|||
Loading…
Reference in New Issue