()
| 35 | const listeners = new Set(); |
| 36 | |
| 37 | function getDefaultState() { |
| 38 | return { |
| 39 | adFreeUntil: 0, |
| 40 | lastExpiredRewardUntil: 0, |
| 41 | isActive: false, |
| 42 | remainingMs: 0, |
| 43 | redemptionsToday: 0, |
| 44 | remainingRedemptions: 3, |
| 45 | maxRedemptionsPerDay: 3, |
| 46 | maxActivePassMs: 10 * ONE_HOUR, |
| 47 | hasPendingExpiryNotice: false, |
| 48 | expiryNoticePendingUntil: 0, |
| 49 | canRedeem: true, |
| 50 | redeemDisabledReason: "", |
| 51 | }; |
| 52 | } |
| 53 | |
| 54 | function formatDuration(durationMs) { |
| 55 | const totalHours = Math.round(durationMs / ONE_HOUR); |
no outgoing calls
no test coverage detected