From cd523cc8f32b99b62438951854cb7a468fbef3ff Mon Sep 17 00:00:00 2001 From: Sebastian Jambor Date: Tue, 11 Jul 2023 13:07:31 +0200 Subject: [PATCH] fix opening explorer from log --- app/javascript/mastodon/features/activity_log/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/javascript/mastodon/features/activity_log/index.js b/app/javascript/mastodon/features/activity_log/index.js index 99287a0f5..068cf6f23 100644 --- a/app/javascript/mastodon/features/activity_log/index.js +++ b/app/javascript/mastodon/features/activity_log/index.js @@ -18,7 +18,7 @@ const mapStateToProps = (state) => { }; -function Content({ logs, dispatch }) { +function Content({ logs, dispatch, router }) { const darkMode = !(document.body && document.body.classList.contains('theme-mastodon-light')); @@ -35,12 +35,12 @@ function Content({ logs, dispatch }) { clickableLinks onLinkClick={(url) => { dispatch(setExplorerUrl(url)); - this.context.router.history.push('/activitypub_explorer'); + router.history.push('/activitypub_explorer'); }} showExplorerLink onExplorerLinkClick={(data) => { dispatch(setExplorerData(data)); - this.context.router.history.push('/activitypub_explorer'); + router.history.push('/activitypub_explorer'); }} /> @@ -61,6 +61,7 @@ function Content({ logs, dispatch }) { Content.propTypes = { dispatch: PropTypes.func.isRequired, logs: PropTypes.array, + router: PropTypes.object, }; @@ -117,6 +118,7 @@ class ActivityLog extends ImmutablePureComponent { );