Browse Source

Fix logout link not working in safari (#16574)

closed-social-v3
Takeshi Umeda 1 year ago
committed by Eugen Rochko
parent
commit
1bcb3daf7e
4 changed files with 11 additions and 1 deletions
  1. +1
    -0
      app/javascript/mastodon/features/compose/containers/navigation_container.js
  2. +1
    -0
      app/javascript/mastodon/features/compose/index.js
  3. +8
    -1
      app/javascript/mastodon/features/ui/components/confirmation_modal.js
  4. +1
    -0
      app/javascript/mastodon/features/ui/components/link_footer.js

+ 1
- 0
app/javascript/mastodon/features/compose/containers/navigation_container.js View File

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

+ 1
- 0
app/javascript/mastodon/features/compose/index.js View File

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

+ 8
- 1
app/javascript/mastodon/features/ui/components/confirmation_modal.js View File

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

+ 1
- 0
app/javascript/mastodon/features/ui/components/link_footer.js View File

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

Loading…
Cancel
Save