| 446 | } |
| 447 | |
| 448 | jsi::Value CommRustModule::logOutPrimaryDevice( |
| 449 | jsi::Runtime &rt, |
| 450 | jsi::String userID, |
| 451 | jsi::String deviceID, |
| 452 | jsi::String accessToken, |
| 453 | jsi::String signedDeviceList) { |
| 454 | auto userIDRust = jsiStringToRustString(userID, rt); |
| 455 | auto deviceIDRust = jsiStringToRustString(deviceID, rt); |
| 456 | auto accessTokenRust = jsiStringToRustString(accessToken, rt); |
| 457 | auto deviceListRust = jsiStringToRustString(signedDeviceList, rt); |
| 458 | |
| 459 | return createPromiseAsJSIValue( |
| 460 | rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) { |
| 461 | std::string error; |
| 462 | try { |
| 463 | auto currentID = RustPromiseManager::instance.addPromise( |
| 464 | {promise, this->jsInvoker_, innerRt}); |
| 465 | identityLogOutPrimaryDevice( |
| 466 | userIDRust, |
| 467 | deviceIDRust, |
| 468 | accessTokenRust, |
| 469 | deviceListRust, |
| 470 | currentID); |
| 471 | } catch (const std::exception &e) { |
| 472 | error = e.what(); |
| 473 | }; |
| 474 | if (!error.empty()) { |
| 475 | this->jsInvoker_->invokeAsync( |
| 476 | [error, promise]() { promise->reject(error); }); |
| 477 | } |
| 478 | }); |
| 479 | } |
| 480 | |
| 481 | jsi::Value CommRustModule::logOutSecondaryDevice( |
| 482 | jsi::Runtime &rt, |
nothing calls this directly
no test coverage detected