(
client: Client,
promise: Promise<boolean>,
nonce: number,
)
| 529 | } |
| 530 | |
| 531 | private async completeOperation( |
| 532 | client: Client, |
| 533 | promise: Promise<boolean>, |
| 534 | nonce: number, |
| 535 | ): Promise<void> { |
| 536 | const response = {type: 'OPERATION_COMPLETED', nonce}; |
| 537 | try { |
| 538 | client.postMessage({ |
| 539 | ...response, |
| 540 | result: await promise, |
| 541 | }); |
| 542 | } catch (e) { |
| 543 | client.postMessage({ |
| 544 | ...response, |
| 545 | error: (e as Error).toString(), |
| 546 | }); |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | async updateClient(client: Client): Promise<boolean> { |
| 551 | // Figure out which version the client is on. If it's not on the latest, |
no test coverage detected