| 2196 | } |
| 2197 | |
| 2198 | jsi::Value CommCoreModule::clearSensitiveData(jsi::Runtime &rt) { |
| 2199 | return createPromiseAsJSIValue( |
| 2200 | rt, [this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) { |
| 2201 | GlobalDBSingleton::instance.setTasksCancelled(true); |
| 2202 | taskType job = [this, promise]() { |
| 2203 | std::string error; |
| 2204 | try { |
| 2205 | this->innerClearCommServicesAuthMetadata(); |
| 2206 | DatabaseManager::clearSensitiveData(); |
| 2207 | } catch (const std::exception &e) { |
| 2208 | error = e.what(); |
| 2209 | } |
| 2210 | this->jsInvoker_->invokeAsync([error, promise]() { |
| 2211 | if (error.size()) { |
| 2212 | promise->reject(error); |
| 2213 | } else { |
| 2214 | promise->resolve(jsi::Value::undefined()); |
| 2215 | } |
| 2216 | }); |
| 2217 | GlobalDBSingleton::instance.scheduleOrRun( |
| 2218 | []() { GlobalDBSingleton::instance.setTasksCancelled(false); }); |
| 2219 | }; |
| 2220 | GlobalDBSingleton::instance.scheduleOrRun(job); |
| 2221 | }); |
| 2222 | } |
| 2223 | |
| 2224 | bool CommCoreModule::checkIfDatabaseNeedsDeletion(jsi::Runtime &rt) { |
| 2225 | return DatabaseManager::checkIfDatabaseNeedsDeletion(); |
nothing calls this directly
no test coverage detected