Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2904602
D5626.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5626.diff
View Options
diff --git a/native/data/sqlite-context-provider.js b/native/data/sqlite-context-provider.js
--- a/native/data/sqlite-context-provider.js
+++ b/native/data/sqlite-context-provider.js
@@ -15,6 +15,7 @@
import { commCoreModule } from '../native-modules';
import { useSelector } from '../redux/redux-utils';
+import { StaffContext } from '../staff/staff-context';
import { isTaskCancelledError } from '../utils/error-handling';
import { useStaffCanSee } from '../utils/staff-utils';
import { SQLiteContext } from './sqlite-context';
@@ -33,6 +34,7 @@
const cookie = useSelector(state => state.cookie);
const urlPrefix = useSelector(state => state.urlPrefix);
const staffCanSee = useStaffCanSee();
+ const { staffUserHasBeenLoggedIn } = React.useContext(StaffContext);
const loggedIn = useSelector(isLoggedIn);
const currentLoggedInUserID = useSelector(state =>
state.currentUserInfo?.anonymous ? undefined : state.currentUserInfo?.id,
@@ -45,7 +47,16 @@
databaseCurrentUserInfoID &&
databaseCurrentUserInfoID !== currentLoggedInUserID
) {
+ if (staffCanSee || staffUserHasBeenLoggedIn) {
+ Alert.alert('Starting SQLite database deletion process');
+ }
await commCoreModule.clearSensitiveData();
+ if (staffCanSee || staffUserHasBeenLoggedIn) {
+ Alert.alert(
+ 'SQLite database successfully deleted',
+ 'SQLite database deletion was triggered by change in logged-in user credentials',
+ );
+ }
}
if (currentLoggedInUserID) {
await commCoreModule.setCurrentUserID(currentLoggedInUserID);
@@ -65,7 +76,7 @@
ExitApp.exitApp();
}
}
- }, [currentLoggedInUserID]);
+ }, [currentLoggedInUserID, staffCanSee, staffUserHasBeenLoggedIn]);
React.useEffect(() => {
if (!rehydrateConcluded) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 7, 1:57 AM (21 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2252031
Default Alt Text
D5626.diff (1 KB)
Attached To
Mode
D5626: Display an alert when sensitive data are purged
Attached
Detach File
Event Timeline
Log In to Comment