Page MenuHomePhabricator

D14134.id46353.diff
No OneTemporary

D14134.id46353.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,
@@ -221,6 +200,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
Sat, Dec 21, 10:48 AM (14 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2687461
Default Alt Text
D14134.id46353.diff (1 KB)

Event Timeline