[Glitch] Fix logout link not working in safari

Port b2875b1864 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
signup-info-prompt
Takeshi Umeda 2021-08-06 19:14:13 +09:00 committed by Claire
parent 8d55cb7d71
commit 8681ef85d0
3 changed files with 10 additions and 1 deletions

View File

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

View File

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

View File

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