Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3513366
D6831.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6831.diff
View Options
diff --git a/native/profile/profile-screen.react.js b/native/profile/profile-screen.react.js
--- a/native/profile/profile-screen.react.js
+++ b/native/profile/profile-screen.react.js
@@ -70,6 +70,7 @@
+logOut: (preRequestUserState: PreRequestUserState) => Promise<LogOutResult>,
+staffCanSee: boolean,
+stringForUser: ?string,
+ +isAccountWithPassword: boolean,
};
class ProfileScreen extends React.PureComponent<Props> {
@@ -174,6 +175,22 @@
if (this.loggedOutOrLoggingOut) {
return;
}
+ if (!this.props.isAccountWithPassword) {
+ Alert.alert(
+ 'Log out',
+ 'Are you sure you want to log out?',
+ [
+ { text: 'No', style: 'cancel' },
+ {
+ text: 'Yes',
+ onPress: this.logOutWithoutDeletingNativeCredentialsWrapper,
+ style: 'destructive',
+ },
+ ],
+ { cancelable: true },
+ );
+ return;
+ }
const alertTitle =
Platform.OS === 'ios' ? 'Keep Login Info in Keychain' : 'Keep Login Info';
const alertDescription =
@@ -184,7 +201,10 @@
alertDescription,
[
{ text: 'Cancel', style: 'cancel' },
- { text: 'Keep', onPress: this.logOutButKeepNativeCredentialsWrapper },
+ {
+ text: 'Keep',
+ onPress: this.logOutWithoutDeletingNativeCredentialsWrapper,
+ },
{
text: 'Remove',
onPress: this.logOutAndDeleteNativeCredentialsWrapper,
@@ -195,7 +215,7 @@
);
};
- logOutButKeepNativeCredentialsWrapper = () => {
+ logOutWithoutDeletingNativeCredentialsWrapper = () => {
if (this.loggedOutOrLoggingOut) {
return;
}
@@ -356,6 +376,9 @@
const dispatchActionPromise = useDispatchActionPromise();
const staffCanSee = useStaffCanSee();
const stringForUser = useStringForUser(currentUserInfo);
+ const isAccountWithPassword = useSelector(state =>
+ accountHasPassword(state.currentUserInfo),
+ );
return (
<ProfileScreen
@@ -369,6 +392,7 @@
dispatchActionPromise={dispatchActionPromise}
staffCanSee={staffCanSee}
stringForUser={stringForUser}
+ isAccountWithPassword={isAccountWithPassword}
/>
);
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 11:56 PM (18 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2692912
Default Alt Text
D6831.diff (2 KB)
Attached To
Mode
D6831: [native] Don't prompt SIWE users about keeping login info on logout
Attached
Detach File
Event Timeline
Log In to Comment