From 747d9f0c5143cb151abe26614feadeebb516104d Mon Sep 17 00:00:00 2001 From: joker-x Date: Mon, 7 Sep 2020 14:37:16 +0200 Subject: [PATCH] Add bool prop "forceReload" to DropdownLink component --- client/src/lib/page.js | 13 ++++++++++--- client/src/root.js | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/client/src/lib/page.js b/client/src/lib/page.js index 898c96cd..94d8505f 100644 --- a/client/src/lib/page.js +++ b/client/src/lib/page.js @@ -604,16 +604,23 @@ export class LinkButton extends Component { export class DropdownLink extends Component { static propTypes = { to: PropTypes.string, - className: PropTypes.string + className: PropTypes.string, + forceReload: PropTypes.bool } render() { const props = this.props; const clsName = "dropdown-item" + (props.className ? " " + props.className : "") - return ( + if (props.forceReload) { + return ( window.location.href=props.to}>{props.children} - ); + ); + } else { + return ( + {props.children} + ); + } } } diff --git a/client/src/root.js b/client/src/root.js index 5a3f7e55..5a40faad 100644 --- a/client/src/root.js +++ b/client/src/root.js @@ -96,7 +96,7 @@ class Root extends Component { {getLanguageChooser(t)} {t('account')} - {mailtrainConfig.authMethod == 'cas' && {t('logOut')}} + {mailtrainConfig.authMethod == 'cas' && {t('logOut')}} {mailtrainConfig.authMethod != 'cas' && {t('logOut')}}