diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-08-10 00:25:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-10 00:25:33 +0200 |
commit | 70b7ac9ff32a713e71a7ba6408a379b601c6839f (patch) | |
tree | f048b304f0d4f0f49e51c2edb8b74ccae6ac89e6 /app/javascript/flavours/glitch/features/ui/components | |
parent | a61645ed30b854a1b4935026801eb5b287954095 (diff) | |
parent | 8681ef85d0728b9d34dc62785fab6fcec30ba95c (diff) |
Merge pull request #1583 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/components')
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js | 9 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/components/link_footer.js | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js index 47a49c0c7..a665b9fb1 100644 --- a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js @@ -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 = () => { - this.props.onClose(); + if (this.props.closeWhenConfirm) { + this.props.onClose(); + } this.props.onConfirm(); if (this.props.onDoNotAsk && this.doNotAskCheckbox.checked) { this.props.onDoNotAsk(); diff --git a/app/javascript/flavours/glitch/features/ui/components/link_footer.js b/app/javascript/flavours/glitch/features/ui/components/link_footer.js index 40ef506cc..722b47140 100644 --- a/app/javascript/flavours/glitch/features/ui/components/link_footer.js +++ b/app/javascript/flavours/glitch/features/ui/components/link_footer.js @@ -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(), })); }, |