0
0
Fork 0

Remove setting for unfollow confirmation modal, and make it unconditional (#29373)

This commit is contained in:
Claire 2024-03-22 17:24:04 +01:00 committed by GitHub
parent 119c7aa0df
commit 37ca59815c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 46 additions and 77 deletions

View file

@ -13,7 +13,6 @@ import {
import { openModal } from '../actions/modal';
import { initMuteModal } from '../actions/mutes';
import Account from '../components/account';
import { unfollowModal } from '../initial_state';
import { makeGetAccount } from '../selectors';
const messages = defineMessages({
@ -34,18 +33,14 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
onFollow (account) {
if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {
if (unfollowModal) {
dispatch(openModal({
modalType: 'CONFIRM',
modalProps: {
message: <FormattedMessage id='confirmations.unfollow.message' defaultMessage='Are you sure you want to unfollow {name}?' values={{ name: <strong>@{account.get('acct')}</strong> }} />,
confirm: intl.formatMessage(messages.unfollowConfirm),
onConfirm: () => dispatch(unfollowAccount(account.get('id'))),
},
}));
} else {
dispatch(unfollowAccount(account.get('id')));
}
dispatch(openModal({
modalType: 'CONFIRM',
modalProps: {
message: <FormattedMessage id='confirmations.unfollow.message' defaultMessage='Are you sure you want to unfollow {name}?' values={{ name: <strong>@{account.get('acct')}</strong> }} />,
confirm: intl.formatMessage(messages.unfollowConfirm),
onConfirm: () => dispatch(unfollowAccount(account.get('id'))),
},
}));
} else {
dispatch(followAccount(account.get('id')));
}