From 7183eeb36bbf3b51f76bead162933b6cc16cd106 Mon Sep 17 00:00:00 2001 From: YoheiZuho Date: Sun, 31 Dec 2023 07:40:51 +0000 Subject: [PATCH] fix quote cant jump post --- app/javascript/mastodon/components/status.jsx | 8 ++++---- .../features/status/components/detailed_status.jsx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/javascript/mastodon/components/status.jsx b/app/javascript/mastodon/components/status.jsx index 3dfd898f7..c50f3395b 100644 --- a/app/javascript/mastodon/components/status.jsx +++ b/app/javascript/mastodon/components/status.jsx @@ -270,16 +270,16 @@ class Status extends ImmutablePureComponent { }; handleQuoteClick = () => { - if (!this.context.router) { + if (!this.props) { return; } const { status } = this.props; - this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'quote', 'id'], status.getIn(['quote', 'id']))}`); + this.props.history.push(`/statuses/${status.getIn(['reblog', 'quote', 'id'], status.getIn(['quote', 'id']))}`); } handleQuoteUserClick = () =>{ - if (!this.context.router) { + if (!this.props) { return; } @@ -708,7 +708,7 @@ class Status extends ImmutablePureComponent { {media(status)} - {quote(status, this.props.muted, quoteMuted, this.handleQuoteClick, this.handleExpandedQuoteToggle, identity, media, this.context.router, contextType)} + {quote(status, this.props.muted, quoteMuted, this.handleQuoteClick, this.handleExpandedQuoteToggle, identity, media, this.props, contextType)} {expanded && hashtagBar} diff --git a/app/javascript/mastodon/features/status/components/detailed_status.jsx b/app/javascript/mastodon/features/status/components/detailed_status.jsx index 4402a5597..c81d83d71 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.jsx +++ b/app/javascript/mastodon/features/status/components/detailed_status.jsx @@ -82,16 +82,16 @@ class DetailedStatus extends ImmutablePureComponent { } handleQuoteClick = () => { - if (!this.context.router) { + if (!this.props) { return; } const { status } = this.props; - this.context.router.history.push(`/statuses/${status.getIn(['quote', 'id'])}`); + this.props.history.push(`/statuses/${status.getIn(['quote', 'id'])}`); } handleQuoteUserClick = () =>{ - if (!this.context.router) { + if (!this.props) { return; } @@ -347,7 +347,7 @@ class DetailedStatus extends ImmutablePureComponent { {media(status, false)} - {quote(status, false, quoteMuted, this.handleQuoteClick, this.handleExpandedQuoteToggle, identity, media, this.context.router)} + {quote(status, false, quoteMuted, this.handleQuoteClick, this.handleExpandedQuoteToggle, identity, media, this.props)} {expanded && hashtagBar}