()
| 157 | } |
| 158 | |
| 159 | function scheduleExpiryCheck() { |
| 160 | clearExpiryTimer(); |
| 161 | if (!state.adFreeUntil) return; |
| 162 | |
| 163 | const remainingMs = state.adFreeUntil - Date.now(); |
| 164 | if (remainingMs <= 0) { |
| 165 | void refreshState({ notifyExpiry: true }); |
| 166 | return; |
| 167 | } |
| 168 | |
| 169 | expiryTimer = setTimeout( |
| 170 | () => { |
| 171 | void refreshState({ notifyExpiry: true }); |
| 172 | }, |
| 173 | Math.min(remainingMs, MAX_TIMEOUT), |
| 174 | ); |
| 175 | } |
| 176 | |
| 177 | async function getRewardIdentity() { |
| 178 | try { |
no test coverage detected