Skip to content

Commit

Permalink
Add back in safeguards
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed Dec 4, 2024
1 parent 524b968 commit 321c49f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions web/components/home/daily-loan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { GiOpenChest, GiTwoCoins } from 'react-icons/gi'
import { Col } from 'web/components/layout/col'
import { TRADE_TERM } from 'common/envs/constants'
import { useAPIGetter } from 'web/hooks/use-api-getter'
import { DAY_MS } from 'common/util/time'

dayjs.extend(utc)
dayjs.extend(timezone)
Expand All @@ -41,7 +42,7 @@ export function DailyLoan(props: {
const { data } = useAPIGetter('get-next-loan-amount', {})
const notEligibleForLoan = (data?.amount ?? 0) < 1

const receivedLoanToday = false //receivedTxnLoan || justReceivedLoan
const receivedLoanToday = receivedTxnLoan || justReceivedLoan

const getLoan = async () => {
if (receivedLoanToday || notEligibleForLoan) {
Expand Down Expand Up @@ -75,10 +76,10 @@ export function DailyLoan(props: {
api('me/update', { hasSeenLoanModal: true })
}, [showLoansModal])

// const createdRecently = user.createdTime > Date.now() - 2 * DAY_MS
// if (createdRecently) {
// return null
// }
const createdRecently = user.createdTime > Date.now() - 2 * DAY_MS
if (createdRecently) {
return null
}
if (showChest) {
return (
<Col
Expand Down

0 comments on commit 321c49f

Please sign in to comment.