MCPcopy Create free account
hub / github.com/CommE2E/comm / clearSensitiveData

Function clearSensitiveData

native/data/sqlite-data-handler.js:27–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25import { useStaffCanSee } from '../utils/staff-utils.js';
26
27async function clearSensitiveData() {
28 try {
29 setDatabaseResetStatus(databaseResetStatus.RESET_IN_PROGRESS);
30 await commCoreModule.clearSensitiveData();
31 setDatabaseResetStatus(databaseResetStatus.READY);
32 reportDatabaseDeleted();
33 } catch (error) {
34 console.log(
35 `Error clearing SQLite database: ${
36 getMessageForException(error) ?? 'unknown'
37 }`,
38 );
39 throw error;
40 }
41 try {
42 await filesystemMediaCache.clearCache();
43 } catch {
44 throw new Error('clear_media_cache_failed');
45 }
46}
47
48function SQLiteDataHandler(): React.Node {
49 const initialStateLoaded = useSelector(state => state.initialStateLoaded);

Callers 5

wipeAndExitFunction · 0.90
SQLiteDataHandlerFunction · 0.70
clearSensitiveDataMethod · 0.50
clearSensitiveDataMethod · 0.50
clearSensitiveDataMethod · 0.50

Calls 6

setDatabaseResetStatusFunction · 0.90
reportDatabaseDeletedFunction · 0.90
getMessageForExceptionFunction · 0.90
clearCacheMethod · 0.80
clearSensitiveDataMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected