| 420 | } |
| 421 | |
| 422 | jsi::Value CommRustModule::logOut( |
| 423 | jsi::Runtime &rt, |
| 424 | jsi::String userID, |
| 425 | jsi::String deviceID, |
| 426 | jsi::String accessToken) { |
| 427 | auto userIDRust = jsiStringToRustString(userID, rt); |
| 428 | auto deviceIDRust = jsiStringToRustString(deviceID, rt); |
| 429 | auto accessTokenRust = jsiStringToRustString(accessToken, rt); |
| 430 | |
| 431 | return createPromiseAsJSIValue( |
| 432 | rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) { |
| 433 | std::string error; |
| 434 | try { |
| 435 | auto currentID = RustPromiseManager::instance.addPromise( |
| 436 | {promise, this->jsInvoker_, innerRt}); |
| 437 | identityLogOut(userIDRust, deviceIDRust, accessTokenRust, currentID); |
| 438 | } catch (const std::exception &e) { |
| 439 | error = e.what(); |
| 440 | }; |
| 441 | if (!error.empty()) { |
| 442 | this->jsInvoker_->invokeAsync( |
| 443 | [error, promise]() { promise->reject(error); }); |
| 444 | } |
| 445 | }); |
| 446 | } |
| 447 | |
| 448 | jsi::Value CommRustModule::logOutPrimaryDevice( |
| 449 | jsi::Runtime &rt, |
nothing calls this directly
no test coverage detected