summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared
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/shared
parent91a30f07505eaea3f4669ba874ee497af43d89a3 (diff)
parent3eaff61fca0121bb1a555624d00a6984d3e562c9 (diff)
downloadmullvadvpn-a77a58850d4e005df88acbac27782c0a382ce6b8.tar.xz
mullvadvpn-a77a58850d4e005df88acbac27782c0a382ce6b8.zip
Merge branch 'improve-account-data-fetching'
Diffstat (limited to 'gui/src/shared')
-rw-r--r--gui/src/shared/account-expiry.ts4
-rw-r--r--gui/src/shared/ipc-schema.ts1
2 files changed, 3 insertions, 2 deletions
diff --git a/gui/src/shared/account-expiry.ts b/gui/src/shared/account-expiry.ts
index 7ca382efb2..81c45fec07 100644
--- a/gui/src/shared/account-expiry.ts
+++ b/gui/src/shared/account-expiry.ts
@@ -5,10 +5,10 @@ export function hasExpired(expiry: DateType): boolean {
return new Date(expiry).getTime() < Date.now();
}
-export function closeToExpiry(expiry: DateType): boolean {
+export function closeToExpiry(expiry: DateType, days = 3): boolean {
return (
!hasExpired(expiry) &&
- new Date(expiry) <= dateByAddingComponent(new Date(), DateComponent.day, 3)
+ new Date(expiry) <= dateByAddingComponent(new Date(), DateComponent.day, days)
);
}
diff --git a/gui/src/shared/ipc-schema.ts b/gui/src/shared/ipc-schema.ts
index 5789bcc149..e2b3ebbed3 100644
--- a/gui/src/shared/ipc-schema.ts
+++ b/gui/src/shared/ipc-schema.ts
@@ -164,6 +164,7 @@ export const ipcSchema = {
logout: invoke<void, void>(),
getWwwAuthToken: invoke<void, string>(),
submitVoucher: invoke<string, VoucherResponse>(),
+ updateData: send<void>(),
},
accountHistory: {
'': notifyRenderer<AccountToken | undefined>(),