Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3401851
D7680.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
D7680.diff
View Options
diff --git a/native/chat/chat-input-bar.react.js b/native/chat/chat-input-bar.react.js
--- a/native/chat/chat-input-bar.react.js
+++ b/native/chat/chat-input-bar.react.js
@@ -911,19 +911,7 @@
saveExit();
return;
}
- Alert.alert(
- 'Discard changes?',
- 'You have unsaved changes. Are you sure to discard them and leave the ' +
- 'screen?',
- [
- { text: 'Don’t leave', style: 'cancel' },
- {
- text: 'Discard edit',
- style: 'destructive',
- onPress: saveExit,
- },
- ],
- );
+ exitEditAlert(saveExit);
};
onPressJoin = () => {
diff --git a/native/utils/edit-messages-utils.js b/native/utils/edit-messages-utils.js
--- a/native/utils/edit-messages-utils.js
+++ b/native/utils/edit-messages-utils.js
@@ -13,19 +13,23 @@
}
function exitEditAlert(onDiscard: () => void): void {
- Alert.alert('Are you sure?', 'Your edits will be discarded.', [
- {
- text: 'Continue editing',
- style: 'cancel',
- },
- {
- text: 'Discard edit',
- style: 'destructive',
- onPress: () => {
- onDiscard();
+ Alert.alert(
+ 'Discard changes?',
+ 'You have unsaved changes which will be discarded if you navigate away.',
+ [
+ {
+ text: 'Continue editing',
+ style: 'cancel',
},
- },
- ]);
+ {
+ text: 'Discard edit',
+ style: 'destructive',
+ onPress: () => {
+ onDiscard();
+ },
+ },
+ ],
+ );
}
export { useShouldRenderEditButton, exitEditAlert };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 2:16 PM (2 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611959
Default Alt Text
D7680.diff (1 KB)
Attached To
Mode
D7680: [native] Used predefined function for discard edit mode alert
Attached
Detach File
Event Timeline
Log In to Comment