()
| 659 | } |
| 660 | |
| 661 | async function whenReady(): Promise<void> { |
| 662 | return new Promise<void>((resolve) => { |
| 663 | const wait = () => { |
| 664 | if (state.readyForInit) { |
| 665 | resolve(); |
| 666 | } else { |
| 667 | setTimeout(wait, 1000); |
| 668 | } |
| 669 | }; |
| 670 | wait(); |
| 671 | }); |
| 672 | } |
| 673 | |
| 674 | async function initialize() { |
| 675 | await whenReady(); |