()
| 87 | } |
| 88 | |
| 89 | const getValidOfflineLicense = (): getValidOfflineLicense | null => { |
| 90 | const payload = getDecodedOfflineLicense(); |
| 91 | if (!payload) { |
| 92 | return null; |
| 93 | } |
| 94 | |
| 95 | const expiryDate = new Date(payload.expiryDate); |
| 96 | if (expiryDate.getTime() < new Date().getTime()) { |
| 97 | return null; |
| 98 | } |
| 99 | |
| 100 | return payload; |
| 101 | } |
| 102 | |
| 103 | // If the license hasn't successfully synced with Lighthouse for this long, |
| 104 | // the locally-cached state is no longer trusted. This guards against an |
no test coverage detected