Skip to content

Commit

Permalink
Change: #742 スマホで引用・参照をおこなったとき、投稿画面へ遷移するよう変更
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed Jun 23, 2024
1 parent 215c60c commit 6f9e6cf
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
16 changes: 10 additions & 6 deletions app/javascript/mastodon/actions/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
}

Expand Down
4 changes: 2 additions & 2 deletions app/javascript/mastodon/components/status_action_bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
8 changes: 4 additions & 4 deletions app/javascript/mastodon/containers/status_container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
8 changes: 4 additions & 4 deletions app/javascript/mastodon/features/status/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 6f9e6cf

Please sign in to comment.