summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/components
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-07-08 13:24:04 +0200
committerOskar Nyberg <oskar@mullvad.net>2021-07-08 13:24:04 +0200
commita77a58850d4e005df88acbac27782c0a382ce6b8 (patch)
tree8c41f5052ea265b5470629be4612476e292e28d9 /gui/src/renderer/components
parent91a30f07505eaea3f4669ba874ee497af43d89a3 (diff)
parent3eaff61fca0121bb1a555624d00a6984d3e562c9 (diff)
downloadmullvadvpn-a77a58850d4e005df88acbac27782c0a382ce6b8.tar.xz
mullvadvpn-a77a58850d4e005df88acbac27782c0a382ce6b8.zip
Merge branch 'improve-account-data-fetching'
Diffstat (limited to 'gui/src/renderer/components')
-rw-r--r--gui/src/renderer/components/Account.tsx5
-rw-r--r--gui/src/renderer/components/Settings.tsx9
2 files changed, 14 insertions, 0 deletions
diff --git a/gui/src/renderer/components/Account.tsx b/gui/src/renderer/components/Account.tsx
index 18980ca1a9..02e2b9f081 100644
--- a/gui/src/renderer/components/Account.tsx
+++ b/gui/src/renderer/components/Account.tsx
@@ -31,9 +31,14 @@ interface IProps {
onLogout: () => void;
onClose: () => void;
onBuyMore: () => Promise<void>;
+ updateAccountData: () => void;
}
export default class Account extends React.Component<IProps> {
+ public componentDidMount() {
+ this.props.updateAccountData();
+ }
+
public render() {
return (
<ModalContainer>
diff --git a/gui/src/renderer/components/Settings.tsx b/gui/src/renderer/components/Settings.tsx
index 56b8fd5494..1610f776f9 100644
--- a/gui/src/renderer/components/Settings.tsx
+++ b/gui/src/renderer/components/Settings.tsx
@@ -2,6 +2,7 @@ import * as React from 'react';
import { colors, links } from '../../config.json';
import { hasExpired, formatRemainingTime } from '../../shared/account-expiry';
import { messages } from '../../shared/gettext';
+import History from '../lib/history';
import { AriaDescribed, AriaDescription, AriaDescriptionGroup } from './AriaGroup';
import * as Cell from './cell';
import { Layout } from './Layout';
@@ -42,9 +43,17 @@ export interface IProps {
onViewPreferences: () => void;
onViewAdvancedSettings: () => void;
onExternalLink: (url: string) => void;
+ updateAccountData: () => void;
+ history: History;
}
export default class Settings extends React.Component<IProps> {
+ public componentDidMount() {
+ if (this.props.history.action === 'PUSH') {
+ this.props.updateAccountData();
+ }
+ }
+
public render() {
const showLargeTitle = this.props.loginState.type !== 'ok';