Skip to content

Commit

Permalink
fixed credits bug smh
Browse files Browse the repository at this point in the history
  • Loading branch information
noahgsolomon committed Jul 29, 2024
1 parent 9ea4054 commit fc3073b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/app/generationtype.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default function GenerationType() {
</div>
</div>
) : null}
{user.userId && !userDB?.subscribed && userDB?.credits === 0 ? (
{user.userId && !userDB?.subscribed && (userDB?.credits ?? 0) <= 0 ? (
<div className="absolute bottom-0 left-0 right-0 top-0 z-30 flex items-center justify-center rounded-lg bg-black bg-opacity-60 ">
<div className="flex max-w-[300px] flex-col gap-0 rounded-lg border border-border bg-card/80 p-4 text-center text-sm shadow-sm">
<div className="flex flex-col gap-2 font-bold">
Expand Down Expand Up @@ -226,7 +226,7 @@ export default function GenerationType() {
typeSelected === "math" ||
generating ||
!user.userId ||
userDB?.credits === 0
(userDB?.credits ?? 0) <= 0
}
onClick={() => {
// router.push(`/notes/${noteId}`);
Expand All @@ -253,7 +253,7 @@ export default function GenerationType() {
typeSelected === "math" ||
generating ||
!user.userId ||
userDB?.credits === 0
(userDB?.credits ?? 0) <= 0
}
onClick={() => {
setGenerating(true);
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export default function Home({
</p>
</div>
{!userDB?.user?.subscribed &&
userDB?.user?.credits === 0 &&
(userDB?.user?.credits ?? 0) <= 0 &&
!pendingVideo ? (
<div className="flex max-w-[300px] flex-col gap-0 rounded-lg border border-border bg-card/80 p-4 text-center text-sm shadow-sm">
<div className="flex flex-col gap-2 font-bold">
Expand Down

0 comments on commit fc3073b

Please # to comment.