Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3406647
D8271.id27922.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
D8271.id27922.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
@@ -111,6 +111,8 @@
activeThreadSelector,
} from '../navigation/nav-selectors.js';
import { NavContext } from '../navigation/navigation-context.js';
+import { OverlayContext } from '../navigation/overlay-context.js';
+import type { OverlayContextType } from '../navigation/overlay-context.js';
import {
type NavigationRoute,
ChatCameraModalRouteName,
@@ -171,6 +173,7 @@
) => Promise<SendEditMessageResponse>,
+navigation: ?ChatNavigationProp<'MessageList'>,
+isFocused?: boolean,
+ +overlayContext: ?OverlayContextType,
};
type State = {
+text: string,
@@ -895,7 +898,9 @@
unblockAndDispatch();
return;
}
- exitEditAlert(unblockAndDispatch);
+ exitEditAlert(unblockAndDispatch, () => {
+ this.props.overlayContext?.setScrollBlockingModalStatus('closed');
+ });
};
blockNavigation = () => {
@@ -1223,6 +1228,7 @@
getDefaultTextMessageRules().simpleMarkdownRules,
);
const editMessage = useEditMessage();
+ const overlayContext = React.useContext(OverlayContext);
return (
<ChatInputBar
@@ -1249,6 +1255,7 @@
editedMessageInfo={editedMessageInfo}
editMessage={editMessage}
navigation={props.navigation}
+ overlayContext={overlayContext}
/>
);
}
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
@@ -2,7 +2,7 @@
import Alert from 'react-native/Libraries/Alert/Alert.js';
-function exitEditAlert(onDiscard: () => void): void {
+function exitEditAlert(onDiscard: () => void, onPress: ?() => void): void {
Alert.alert(
'Discard changes?',
'You have unsaved changes which will be discarded if you navigate away.',
@@ -10,13 +10,12 @@
{
text: 'Continue editing',
style: 'cancel',
+ onPress: onPress,
},
{
text: 'Discard edit',
style: 'destructive',
- onPress: () => {
- onDiscard();
- },
+ onPress: onDiscard,
},
],
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 2:44 AM (14 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2615666
Default Alt Text
D8271.id27922.diff (2 KB)
Attached To
Mode
D8271: [native] Unblock scrolling when continuing editing
Attached
Detach File
Event Timeline
Log In to Comment