| 703 | } |
| 704 | |
| 705 | jsi::Value CommRustModule::getDeviceListsForUsers( |
| 706 | jsi::Runtime &rt, |
| 707 | jsi::String authUserID, |
| 708 | jsi::String authDeviceID, |
| 709 | jsi::String authAccessToken, |
| 710 | jsi::Array userIDs) { |
| 711 | auto authUserIDRust = jsiStringToRustString(authUserID, rt); |
| 712 | auto authDeviceIDRust = jsiStringToRustString(authDeviceID, rt); |
| 713 | auto authAccessTokenRust = jsiStringToRustString(authAccessToken, rt); |
| 714 | auto userIDsRust = jsiStringArrayToRustVec(userIDs, rt); |
| 715 | |
| 716 | return createPromiseAsJSIValue( |
| 717 | rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) { |
| 718 | std::string error; |
| 719 | try { |
| 720 | auto currentID = RustPromiseManager::instance.addPromise( |
| 721 | {promise, this->jsInvoker_, innerRt}); |
| 722 | identityGetDeviceListsForUsers( |
| 723 | authUserIDRust, |
| 724 | authDeviceIDRust, |
| 725 | authAccessTokenRust, |
| 726 | userIDsRust, |
| 727 | currentID); |
| 728 | } catch (const std::exception &e) { |
| 729 | error = e.what(); |
| 730 | }; |
| 731 | if (!error.empty()) { |
| 732 | this->jsInvoker_->invokeAsync( |
| 733 | [error, promise]() { promise->reject(error); }); |
| 734 | } |
| 735 | }); |
| 736 | } |
| 737 | |
| 738 | jsi::Value CommRustModule::updateDeviceList( |
| 739 | jsi::Runtime &rt, |
nothing calls this directly
no test coverage detected