Page MenuHomePhabricator

D14134.diff
No OneTemporary

D14134.diff

diff --git a/native/chat/multimedia-message-multimedia.react.js b/native/chat/multimedia-message-multimedia.react.js
--- a/native/chat/multimedia-message-multimedia.react.js
+++ b/native/chat/multimedia-message-multimedia.react.js
@@ -67,27 +67,6 @@
};
class MultimediaMessageMultimedia extends React.PureComponent<Props> {
- static getOverlayContext(props: Props): OverlayContextType {
- const { overlayContext } = props;
- invariant(
- overlayContext,
- 'MultimediaMessageMultimedia should have OverlayContext',
- );
- return overlayContext;
- }
-
- componentDidUpdate(prevProps: Props) {
- const scrollIsDisabled =
- MultimediaMessageMultimedia.getOverlayContext(this.props)
- .scrollBlockingModalStatus !== 'closed';
- const scrollWasDisabled =
- MultimediaMessageMultimedia.getOverlayContext(prevProps)
- .scrollBlockingModalStatus !== 'closed';
- if (!scrollIsDisabled && scrollWasDisabled) {
- this.props.setClickable(true);
- }
- }
-
render(): React.Node {
const {
mediaInfo,
@@ -219,6 +198,17 @@
};
});
+ const scrollWasDisabled = React.useRef<?boolean>();
+
+ React.useEffect(() => {
+ const scrollIsDisabled =
+ overlayContext.scrollBlockingModalStatus !== 'closed';
+ if (!scrollIsDisabled && scrollWasDisabled.current) {
+ props.setClickable(true);
+ }
+ scrollWasDisabled.current = scrollIsDisabled;
+ }, [overlayContext.scrollBlockingModalStatus, props]);
+
return (
<MultimediaMessageMultimedia
{...props}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 2:14 PM (16 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2674645
Default Alt Text
D14134.diff (1 KB)

Event Timeline