()
| 287 | return Math.max(0, state.remainingMs || state.adFreeUntil - Date.now()); |
| 288 | }, |
| 289 | getRemainingLabel() { |
| 290 | const remainingMs = this.getRemainingMs(); |
| 291 | if (!remainingMs) return "No active ad-free pass"; |
| 292 | |
| 293 | const minutes = Math.ceil(remainingMs / (60 * 1000)); |
| 294 | if (minutes < 60) { |
| 295 | return `${minutes} minute${minutes === 1 ? "" : "s"} remaining`; |
| 296 | } |
| 297 | |
| 298 | const hours = Math.floor(minutes / 60); |
| 299 | const remMinutes = minutes % 60; |
| 300 | if (!remMinutes) { |
| 301 | return `${hours} hour${hours === 1 ? "" : "s"} remaining`; |
| 302 | } |
| 303 | |
| 304 | return `${hours}h ${remMinutes}m remaining`; |
| 305 | }, |
| 306 | getExpiryLabel() { |
| 307 | const expiryDate = getExpiryDate(); |
| 308 | if (!expiryDate) return "No active pass"; |
nothing calls this directly
no outgoing calls
no test coverage detected