From f7d978b7e359d70612365c1e19acfe9d24c91c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KMY=EF=BC=88=E9=9B=AA=E3=81=82=E3=81=99=E3=81=8B=EF=BC=89?= Date: Mon, 24 Jun 2024 12:18:57 +0900 Subject: [PATCH] =?UTF-8?q?Change:=20#742=20=E3=82=B9=E3=83=9E=E3=83=9B?= =?UTF-8?q?=E3=81=A7=E5=BC=95=E7=94=A8=E3=83=BB=E5=8F=82=E7=85=A7=E3=82=92?= =?UTF-8?q?=E3=81=8A=E3=81=93=E3=81=AA=E3=81=A3=E3=81=9F=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E3=80=81=E6=8A=95=E7=A8=BF=E7=94=BB=E9=9D=A2=E3=81=B8=E9=81=B7?= =?UTF-8?q?=E7=A7=BB=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=20(#763)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/mastodon/actions/compose.js | 16 ++++++++++------ .../mastodon/components/status_action_bar.jsx | 4 ++-- .../mastodon/containers/status_container.jsx | 8 ++++---- .../features/status/components/action_bar.jsx | 4 ++-- .../mastodon/features/status/index.jsx | 8 ++++---- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js index 8a8540522f..7bba41ee97 100644 --- a/app/javascript/mastodon/actions/compose.js +++ b/app/javascript/mastodon/actions/compose.js @@ -817,12 +817,16 @@ export function insertFeaturedTagCompose(position, data) { }; } -export function insertReferenceCompose(position, url, attributeType) { - return { - type: COMPOSE_REFERENCE_INSERT, - position, - url, - attributeType, +export function insertReferenceCompose(position, url, attributeType, routerHistory) { + return (dispatch, getState) => { + dispatch({ + type: COMPOSE_REFERENCE_INSERT, + position, + url, + attributeType, + }); + + ensureComposeIsVisible(getState, routerHistory); }; } diff --git a/app/javascript/mastodon/components/status_action_bar.jsx b/app/javascript/mastodon/components/status_action_bar.jsx index d88e68a1e4..1a38189e10 100644 --- a/app/javascript/mastodon/components/status_action_bar.jsx +++ b/app/javascript/mastodon/components/status_action_bar.jsx @@ -290,11 +290,11 @@ class StatusActionBar extends ImmutablePureComponent { }; handleReference = () => { - this.props.onReference(this.props.status); + this.props.onReference(this.props.status, this.props.history); }; handleQuote = () => { - this.props.onQuote(this.props.status); + this.props.onQuote(this.props.status, this.props.history); }; handleHideClick = () => { diff --git a/app/javascript/mastodon/containers/status_container.jsx b/app/javascript/mastodon/containers/status_container.jsx index 1ed546a57b..74490a252d 100644 --- a/app/javascript/mastodon/containers/status_container.jsx +++ b/app/javascript/mastodon/containers/status_container.jsx @@ -203,12 +203,12 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({ }); }, - onReference (status) { - dispatch(insertReferenceCompose(0, status.get('url'), 'BT')); + onReference (status, router) { + dispatch(insertReferenceCompose(0, status.get('url'), 'BT', router)); }, - onQuote (status) { - dispatch(insertReferenceCompose(0, status.get('url'), 'QT')); + onQuote (status, router) { + dispatch(insertReferenceCompose(0, status.get('url'), 'QT', router)); }, onTranslate (status) { diff --git a/app/javascript/mastodon/features/status/components/action_bar.jsx b/app/javascript/mastodon/features/status/components/action_bar.jsx index 6eb4fb1a47..0f35e38cae 100644 --- a/app/javascript/mastodon/features/status/components/action_bar.jsx +++ b/app/javascript/mastodon/features/status/components/action_bar.jsx @@ -225,11 +225,11 @@ class ActionBar extends PureComponent { }; handleReference = () => { - this.props.onReference(this.props.status); + this.props.onReference(this.props.status, this.props.history); }; handleQuote = () => { - this.props.onQuote(this.props.status); + this.props.onQuote(this.props.status, this.props.history); }; handleEmojiPick = (data) => { diff --git a/app/javascript/mastodon/features/status/index.jsx b/app/javascript/mastodon/features/status/index.jsx index 1a8cb39b18..1c0b1ab13d 100644 --- a/app/javascript/mastodon/features/status/index.jsx +++ b/app/javascript/mastodon/features/status/index.jsx @@ -368,12 +368,12 @@ class Status extends ImmutablePureComponent { this.handleReblogClick(status, e, true); }; - handleReference = (status) => { - this.props.dispatch(insertReferenceCompose(0, status.get('url'), 'BT')); + handleReference = (status, router) => { + this.props.dispatch(insertReferenceCompose(0, status.get('url'), 'BT', router)); }; - handleQuote = (status) => { - this.props.dispatch(insertReferenceCompose(0, status.get('url'), 'QT')); + handleQuote = (status, router) => { + this.props.dispatch(insertReferenceCompose(0, status.get('url'), 'QT', router)); }; handleBookmarkClick = (status) => {