From 32d40055167714716c88944c3d625443c4f20ce1 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 23 Jul 2018 16:03:30 +0200 Subject: [PATCH] Treat the App Setting link as a proper link (fixes #375) --- .../glitch/features/drawer/header/index.js | 3 +- .../flavours/glitch/features/drawer/index.js | 30 ++++++++++++++----- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/app/javascript/flavours/glitch/features/drawer/header/index.js b/app/javascript/flavours/glitch/features/drawer/header/index.js index 6949cd0283..deec424358 100644 --- a/app/javascript/flavours/glitch/features/drawer/header/index.js +++ b/app/javascript/flavours/glitch/features/drawer/header/index.js @@ -96,9 +96,8 @@ export default function DrawerHeader ({ ({ }); // Dispatch mapping. -const mapDispatchToProps = { - onChange: changeSearch, - onClear: clearSearch, - onClickElefriend: cycleElefriendCompose, - onShow: showSearch, - onSubmit: submitSearch, - onOpenSettings: openModal.bind(null, 'SETTINGS', {}), -}; +const mapDispatchToProps = (dispatch, { intl }) => ({ + onChange (value) { + dispatch(changeSearch(value)); + }, + onClear () { + dispatch(clearSearch()); + }, + onClickElefriend () { + dispatch(cycleElefriendCompose()); + }, + onShow () { + dispatch(showSearch()); + }, + onSubmit () { + dispatch(submitSearch()); + }, + onOpenSettings (e) { + e.preventDefault(); + e.stopPropagation(); + dispatch(openModal('SETTINGS', {})); + }, +}); // The component. class Drawer extends React.Component {