| 393 | } |
| 394 | |
| 395 | jsi::Value CommRustModule::deleteWalletUser( |
| 396 | jsi::Runtime &rt, |
| 397 | jsi::String userID, |
| 398 | jsi::String deviceID, |
| 399 | jsi::String accessToken) { |
| 400 | auto userIDRust = jsiStringToRustString(userID, rt); |
| 401 | auto deviceIDRust = jsiStringToRustString(deviceID, rt); |
| 402 | auto accessTokenRust = jsiStringToRustString(accessToken, rt); |
| 403 | |
| 404 | return createPromiseAsJSIValue( |
| 405 | rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) { |
| 406 | std::string error; |
| 407 | try { |
| 408 | auto currentID = RustPromiseManager::instance.addPromise( |
| 409 | {promise, this->jsInvoker_, innerRt}); |
| 410 | identityDeleteWalletUser( |
| 411 | userIDRust, deviceIDRust, accessTokenRust, currentID); |
| 412 | } catch (const std::exception &e) { |
| 413 | error = e.what(); |
| 414 | }; |
| 415 | if (!error.empty()) { |
| 416 | this->jsInvoker_->invokeAsync( |
| 417 | [error, promise]() { promise->reject(error); }); |
| 418 | } |
| 419 | }); |
| 420 | } |
| 421 | |
| 422 | jsi::Value CommRustModule::logOut( |
| 423 | jsi::Runtime &rt, |
nothing calls this directly
no test coverage detected