Fix logout link not working in safari (#16574)

master
Takeshi Umeda 3 years ago committed by GitHub
parent 6e0ab6814f
commit b2875b1864
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/javascript/mastodon/features/compose/containers/navigation_container.js
  2. 1
      app/javascript/mastodon/features/compose/index.js
  3. 9
      app/javascript/mastodon/features/ui/components/confirmation_modal.js
  4. 1
      app/javascript/mastodon/features/ui/components/link_footer.js

@ -21,6 +21,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
dispatch(openModal('CONFIRM', { dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.logoutMessage), message: intl.formatMessage(messages.logoutMessage),
confirm: intl.formatMessage(messages.logoutConfirm), confirm: intl.formatMessage(messages.logoutConfirm),
closeWhenConfirm: false,
onConfirm: () => logOut(), onConfirm: () => logOut(),
})); }));
}, },

@ -74,6 +74,7 @@ class Compose extends React.PureComponent {
dispatch(openModal('CONFIRM', { dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.logoutMessage), message: intl.formatMessage(messages.logoutMessage),
confirm: intl.formatMessage(messages.logoutConfirm), confirm: intl.formatMessage(messages.logoutConfirm),
closeWhenConfirm: false,
onConfirm: () => logOut(), onConfirm: () => logOut(),
})); }));

@ -13,15 +13,22 @@ class ConfirmationModal extends React.PureComponent {
onConfirm: PropTypes.func.isRequired, onConfirm: PropTypes.func.isRequired,
secondary: PropTypes.string, secondary: PropTypes.string,
onSecondary: PropTypes.func, onSecondary: PropTypes.func,
closeWhenConfirm: PropTypes.bool,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
}; };
static defaultProps = {
closeWhenConfirm: true,
};
componentDidMount() { componentDidMount() {
this.button.focus(); this.button.focus();
} }
handleClick = () => { handleClick = () => {
this.props.onClose(); if (this.props.closeWhenConfirm) {
this.props.onClose();
}
this.props.onConfirm(); this.props.onConfirm();
} }

@ -17,6 +17,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
dispatch(openModal('CONFIRM', { dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.logoutMessage), message: intl.formatMessage(messages.logoutMessage),
confirm: intl.formatMessage(messages.logoutConfirm), confirm: intl.formatMessage(messages.logoutConfirm),
closeWhenConfirm: false,
onConfirm: () => logOut(), onConfirm: () => logOut(),
})); }));
}, },

Loading…
Cancel
Save