feat: Changes security dialog button to toggle dialog.
This commit is contained in:
parent
b9c20a3fd4
commit
0cef706b6a
|
@ -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));
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue