summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-02-07 15:44:58 +0100
committerOskar Nyberg <oskar@mullvad.net>2022-02-09 12:51:56 +0100
commitce08246ba5ba82f58ce72895d0105d3054026cbb (patch)
treec0aa8ca2f1858d1a8af0cfa9d9392c33161d4f11 /gui/src/renderer
parent5d0be2864ca826669681c0cd3bd818629096225e (diff)
downloadmullvadvpn-ce08246ba5ba82f58ce72895d0105d3054026cbb.tar.xz
mullvadvpn-ce08246ba5ba82f58ce72895d0105d3054026cbb.zip
Remove previousExpiry from IAccountData
Diffstat (limited to 'gui/src/renderer')
-rw-r--r--gui/src/renderer/app.tsx11
-rw-r--r--gui/src/renderer/redux/account/actions.ts4
-rw-r--r--gui/src/renderer/redux/account/reducers.ts5
3 files changed, 5 insertions, 15 deletions
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx
index f5134653a7..e9aadedcc4 100644
--- a/gui/src/renderer/app.tsx
+++ b/gui/src/renderer/app.tsx
@@ -120,7 +120,7 @@ export default class AppRenderer {
});
IpcRendererEventChannel.account.listen((newAccountData?: IAccountData) => {
- this.setAccountExpiry(newAccountData?.expiry, newAccountData?.previousExpiry);
+ this.setAccountExpiry(newAccountData?.expiry);
});
IpcRendererEventChannel.accountHistory.listen((newAccountHistory?: AccountToken) => {
@@ -199,10 +199,7 @@ export default class AppRenderer {
initialState.translations.relayLocations,
);
- this.setAccountExpiry(
- initialState.accountData?.expiry,
- initialState.accountData?.previousExpiry,
- );
+ this.setAccountExpiry(initialState.accountData?.expiry);
this.setSettings(initialState.settings);
this.handleAccountChange(undefined, initialState.settings.accountToken);
this.setAccountHistory(initialState.accountHistory);
@@ -834,8 +831,8 @@ export default class AppRenderer {
this.reduxActions.settings.updateGuiSettings(guiSettings);
}
- private setAccountExpiry(expiry?: string, previousExpiry?: string) {
- this.reduxActions.account.updateAccountExpiry(expiry, previousExpiry);
+ private setAccountExpiry(expiry?: string) {
+ this.reduxActions.account.updateAccountExpiry(expiry);
}
private storeAutoStart(autoStart: boolean) {
diff --git a/gui/src/renderer/redux/account/actions.ts b/gui/src/renderer/redux/account/actions.ts
index 4a9790df00..b8fbe94d39 100644
--- a/gui/src/renderer/redux/account/actions.ts
+++ b/gui/src/renderer/redux/account/actions.ts
@@ -50,7 +50,6 @@ interface IUpdateAccountHistoryAction {
interface IUpdateAccountExpiryAction {
type: 'UPDATE_ACCOUNT_EXPIRY';
expiry?: string;
- previousExpiry?: string;
}
export type AccountAction =
@@ -133,11 +132,10 @@ function updateAccountHistory(accountHistory?: AccountToken): IUpdateAccountHist
};
}
-function updateAccountExpiry(expiry?: string, previousExpiry?: string): IUpdateAccountExpiryAction {
+function updateAccountExpiry(expiry?: string): IUpdateAccountExpiryAction {
return {
type: 'UPDATE_ACCOUNT_EXPIRY',
expiry,
- previousExpiry,
};
}
diff --git a/gui/src/renderer/redux/account/reducers.ts b/gui/src/renderer/redux/account/reducers.ts
index 6b68fef9cf..53bc55db1b 100644
--- a/gui/src/renderer/redux/account/reducers.ts
+++ b/gui/src/renderer/redux/account/reducers.ts
@@ -10,7 +10,6 @@ export interface IAccountReduxState {
accountToken?: AccountToken;
accountHistory?: AccountToken;
expiry?: string; // ISO8601
- previousExpiry?: string; // ISO8601
status: LoginState;
}
@@ -18,7 +17,6 @@ const initialState: IAccountReduxState = {
accountToken: undefined,
accountHistory: undefined,
expiry: undefined,
- previousExpiry: undefined,
status: { type: 'none' },
};
@@ -50,7 +48,6 @@ export default function (
status: { type: 'none' },
accountToken: undefined,
expiry: undefined,
- previousExpiry: undefined,
};
case 'RESET_LOGIN_ERROR':
return {
@@ -73,7 +70,6 @@ export default function (
status: { type: 'ok', method: 'new_account' },
accountToken: action.token,
expiry: action.expiry,
- previousExpiry: undefined,
};
case 'UPDATE_ACCOUNT_TOKEN':
return {
@@ -89,7 +85,6 @@ export default function (
return {
...state,
expiry: action.expiry,
- previousExpiry: action.previousExpiry,
};
}