From 9cb86b1546601082d07dcaf55ac99641ccb561a8 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 23 Oct 2023 11:39:53 +0200 Subject: [PATCH] [Glitch] Fix incorrect proptypes from react-router-v5 update Port 0ad66175bf59a34b03d9ab2347181548d07089ea to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/status.jsx | 4 ++-- app/javascript/flavours/glitch/utils/react_router.jsx | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/components/status.jsx b/app/javascript/flavours/glitch/components/status.jsx index 96f68579615050..54ccbbd9c8c82d 100644 --- a/app/javascript/flavours/glitch/components/status.jsx +++ b/app/javascript/flavours/glitch/components/status.jsx @@ -14,7 +14,7 @@ import PollContainer from 'flavours/glitch/containers/poll_container'; import NotificationOverlayContainer from 'flavours/glitch/features/notifications/containers/overlay_container'; import { displayMedia } from 'flavours/glitch/initial_state'; import { autoUnfoldCW } from 'flavours/glitch/utils/content_warning'; -import { withOptionalRouter, WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; +import { withOptionalRouter, WithOptionalRouterPropTypes } from 'flavours/glitch/utils/react_router'; import Card from '../features/status/components/card'; import Bundle from '../features/ui/components/bundle'; @@ -114,7 +114,7 @@ class Status extends ImmutablePureComponent { inUse: PropTypes.bool, available: PropTypes.bool, }), - ...WithRouterPropTypes, + ...WithOptionalRouterPropTypes, }; state = { diff --git a/app/javascript/flavours/glitch/utils/react_router.jsx b/app/javascript/flavours/glitch/utils/react_router.jsx index a56883270bbd91..fa8f0db2b5cbd6 100644 --- a/app/javascript/flavours/glitch/utils/react_router.jsx +++ b/app/javascript/flavours/glitch/utils/react_router.jsx @@ -49,6 +49,7 @@ export function withOptionalRouter(Component) { C.displayName = displayName; C.WrappedComponent = Component; C.propTypes = { + ...Component.propTypes, wrappedComponentRef: PropTypes.oneOfType([ PropTypes.string, PropTypes.func,