Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33348574
D14134.1768931512.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14134.1768931512.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 20, 5:51 PM (15 m, 16 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5959324
Default Alt Text
D14134.1768931512.diff (1 KB)
Attached To
Mode
D14134: [native] Move componentDidUpdate logic in MultimediaMessageMultimedia to functional component
Attached
Detach File
Event Timeline
Log In to Comment