diff --git a/native/data/sensitive-data-cleaner.react.js b/native/data/sensitive-data-cleaner.react.js
new file mode 100644
--- /dev/null
+++ b/native/data/sensitive-data-cleaner.react.js
@@ -0,0 +1,38 @@
+// @flow
+
+import * as React from 'react';
+import ExitApp from 'react-native-exit-app';
+
+import { useSelector } from '../redux/redux-utils';
+
+function SensitiveDataCleaner(): null {
+ const currentLoggedInUserID = useSelector(state =>
+ state.currentUserInfo?.anonymous ? null : state.currentUserInfo?.id,
+ );
+ React.useEffect(() => {
+ (async () => {
+ try {
+ const databaseCurrentUserInfoID = await global.CommCoreModule.getCurrentUserID();
+ if (
+ databaseCurrentUserInfoID &&
+ databaseCurrentUserInfoID !== currentLoggedInUserID
+ ) {
+ await global.CommCoreModule.clearSensitiveData();
+ }
+ if (currentLoggedInUserID) {
+ await global.CommCoreModule.setCurrentUserID(currentLoggedInUserID);
+ }
+ } catch (e) {
+ if (__DEV__) {
+ throw e;
+ } else {
+ console.log(e);
+ ExitApp.exitApp();
+ }
+ }
+ })();
+ }, [currentLoggedInUserID]);
+ return null;
+}
+
+export { SensitiveDataCleaner };
diff --git a/native/root.react.js b/native/root.react.js
--- a/native/root.react.js
+++ b/native/root.react.js
@@ -22,6 +22,7 @@
import PersistedStateGate from './components/persisted-state-gate';
import ConnectedStatusBar from './connected-status-bar.react';
import CoreDataProvider from './data/core-data-provider.react';
+import { SensitiveDataCleaner } from './data/sensitive-data-cleaner.react';
import { SQLiteContextProvider } from './data/sqlite-context-provider';
import ErrorBoundary from './error-boundary.react';
import InputStateContainer from './input/input-state-container.react';
@@ -222,6 +223,7 @@
+
>
);
let navigation;