()
| 207 | } |
| 208 | let done = false; |
| 209 | const finish = () => { |
| 210 | if (done) return; |
| 211 | done = true; |
| 212 | try { |
| 213 | a.off(a.activityStartedEvent || 'activityStarted', onAny); |
| 214 | a.off(a.activityResumedEvent || 'activityResumed', onAny); |
| 215 | } catch {} |
| 216 | fn(); |
| 217 | }; |
| 218 | const onAny = () => { |
| 219 | if (isReady()) finish(); |
| 220 | }; |