summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/containers
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-11-26 14:19:08 +0100
committerOskar Nyberg <oskar@mullvad.net>2022-03-14 13:58:44 +0100
commitebfdf9289aff8d85266161b17f490bc0a661ffcf (patch)
tree07cd905c535564dfc3b35a63856ec21359aad658 /gui/src/renderer/containers
parent9916f3444c1d15a6d9ad5caba3555e1c0e1a704c (diff)
downloadmullvadvpn-ebfdf9289aff8d85266161b17f490bc0a661ffcf.tar.xz
mullvadvpn-ebfdf9289aff8d85266161b17f490bc0a661ffcf.zip
Add log out confirmation dialog
Diffstat (limited to 'gui/src/renderer/containers')
-rw-r--r--gui/src/renderer/containers/AccountPage.tsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/gui/src/renderer/containers/AccountPage.tsx b/gui/src/renderer/containers/AccountPage.tsx
index a5251500d0..2309c614fb 100644
--- a/gui/src/renderer/containers/AccountPage.tsx
+++ b/gui/src/renderer/containers/AccountPage.tsx
@@ -1,10 +1,12 @@
import { connect } from 'react-redux';
+import { bindActionCreators } from 'redux';
import { links } from '../../config.json';
import Account from '../components/Account';
import withAppContext, { IAppContext } from '../context';
import { IHistoryProps, withHistory } from '../lib/history';
import { IReduxState, ReduxDispatch } from '../redux/store';
+import accountActions from '../redux/account/actions';
const mapStateToProps = (state: IReduxState) => ({
deviceName: state.account.deviceName,
@@ -13,8 +15,12 @@ const mapStateToProps = (state: IReduxState) => ({
expiryLocale: state.userInterface.locale,
isOffline: state.connection.isBlocked,
});
-const mapDispatchToProps = (_dispatch: ReduxDispatch, props: IHistoryProps & IAppContext) => {
+const mapDispatchToProps = (dispatch: ReduxDispatch, props: IHistoryProps & IAppContext) => {
+ const account = bindActionCreators(accountActions, dispatch);
+
return {
+ prepareLogout: () => account.prepareLogout(),
+ cancelLogout: () => account.cancelLogout(),
onLogout: () => {
void props.app.logout();
},
@@ -23,6 +29,7 @@ const mapDispatchToProps = (_dispatch: ReduxDispatch, props: IHistoryProps & IAp
},
onBuyMore: () => props.app.openLinkWithAuth(links.purchase),
updateAccountData: () => props.app.updateAccountData(),
+ getDevice: () => props.app.getDevice(),
};
};