feat: Changes security dialog button to toggle dialog.

This commit is contained in:
damencho 2020-07-17 10:48:23 -05:00 committed by Дамян Минков
parent b9c20a3fd4
commit 0cef706b6a
2 changed files with 6 additions and 6 deletions

View File

@ -1,16 +1,16 @@
// @flow
import { openDialog } from '../base/dialog';
import { toggleDialog } from '../base/dialog';
import { SecurityDialog } from './components/security-dialog';
/**
* Action that triggers opening the security options dialog.
* Action that triggers toggle of the security options dialog.
*
* @returns {Function}
*/
export function openSecurityDialog() {
export function toggleSecurityDialog() {
return function(dispatch: (Object) => Object) {
dispatch(openDialog(SecurityDialog));
dispatch(toggleDialog(SecurityDialog));
};
}

View File

@ -5,7 +5,7 @@ import { translate } from '../../../base/i18n';
import { IconSecurityOff, IconSecurityOn } from '../../../base/icons';
import { connect } from '../../../base/redux';
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox';
import { openSecurityDialog } from '../../actions';
import { toggleSecurityDialog } from '../../actions';
type Props = AbstractButtonProps & {
@ -77,7 +77,7 @@ function mapStateToProps(state: Object) {
* @returns {Props}
*/
const mapDispatchToProps = {
onClick: () => openSecurityDialog()
onClick: () => toggleSecurityDialog()
};
export default translate(connect(mapStateToProps, mapDispatchToProps)(SecurityDialogButton));