| 2165 | } |
| 2166 | |
| 2167 | jsi::Value CommCoreModule::clearSensitiveData(jsi::Runtime &rt) { |
| 2168 | return createPromiseAsJSIValue( |
| 2169 | rt, [this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) { |
| 2170 | GlobalDBSingleton::instance.setTasksCancelled(true); |
| 2171 | taskType job = [this, promise]() { |
| 2172 | std::string error; |
| 2173 | try { |
| 2174 | this->innerClearCommServicesAuthMetadata(); |
| 2175 | DatabaseManager::clearSensitiveData(); |
| 2176 | } catch (const std::exception &e) { |
| 2177 | error = e.what(); |
| 2178 | } |
| 2179 | this->jsInvoker_->invokeAsync([error, promise]() { |
| 2180 | if (error.size()) { |
| 2181 | promise->reject(error); |
| 2182 | } else { |
| 2183 | promise->resolve(jsi::Value::undefined()); |
| 2184 | } |
| 2185 | }); |
| 2186 | GlobalDBSingleton::instance.scheduleOrRun( |
| 2187 | []() { GlobalDBSingleton::instance.setTasksCancelled(false); }); |
| 2188 | }; |
| 2189 | GlobalDBSingleton::instance.scheduleOrRun(job); |
| 2190 | }); |
| 2191 | } |
| 2192 | |
| 2193 | bool CommCoreModule::checkIfDatabaseNeedsDeletion(jsi::Runtime &rt) { |
| 2194 | return DatabaseManager::checkIfDatabaseNeedsDeletion(); |
nothing calls this directly
no test coverage detected