Change: #742 スマホで引用・参照をおこなったとき、投稿画面へ遷移するよう変更 (#763)

This commit is contained in:
KMY(雪あすか) 2024-06-24 12:18:57 +09:00 committed by GitHub
parent e8dfef4bd4
commit f7d978b7e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 18 deletions

View file

@ -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);
};
}

View file

@ -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 = () => {

View file

@ -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) {

View file

@ -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) => {

View file

@ -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) => {