summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/components/NotificationArea.tsx
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-06-15 20:11:24 +0200
committerOskar Nyberg <oskar@mullvad.net>2020-06-24 11:23:07 +0200
commit1f54942ca8da86efeb64b174dcceecdd9e48a85c (patch)
treef1187dd93e4e6cb1f6ee1c91e87e101a7031694b /gui/src/renderer/components/NotificationArea.tsx
parent63193938c1c5719e06eae51f8d213af55125a2de (diff)
downloadmullvadvpn-1f54942ca8da86efeb64b174dcceecdd9e48a85c.tar.xz
mullvadvpn-1f54942ca8da86efeb64b174dcceecdd9e48a85c.zip
Refactor AccountExpiry
Diffstat (limited to 'gui/src/renderer/components/NotificationArea.tsx')
-rw-r--r--gui/src/renderer/components/NotificationArea.tsx10
1 files changed, 3 insertions, 7 deletions
diff --git a/gui/src/renderer/components/NotificationArea.tsx b/gui/src/renderer/components/NotificationArea.tsx
index bc76ba0885..89d742df0a 100644
--- a/gui/src/renderer/components/NotificationArea.tsx
+++ b/gui/src/renderer/components/NotificationArea.tsx
@@ -3,7 +3,6 @@ import log from 'electron-log';
import React, { useCallback } from 'react';
import { useSelector } from 'react-redux';
import { Types } from 'reactxp';
-import AccountExpiry from '../../shared/account-expiry';
import {
AccountExpiryNotificationProvider,
BlockWhenDisconnectedNotificationProvider,
@@ -33,11 +32,8 @@ interface IProps {
}
export default function NotificationArea(props: IProps) {
- const accountExpiry = useSelector((state: IReduxState) =>
- state.account.expiry
- ? new AccountExpiry(state.account.expiry, state.userInterface.locale)
- : undefined,
- );
+ const accountExpiry = useSelector((state: IReduxState) => state.account.expiry);
+ const locale = useSelector((state: IReduxState) => state.userInterface.locale);
const tunnelState = useSelector((state: IReduxState) => state.connection.status);
const version = useSelector((state: IReduxState) => state.version);
const blockWhenDisconnected = useSelector(
@@ -55,7 +51,7 @@ export default function NotificationArea(props: IProps) {
];
if (accountExpiry) {
- notificationProviders.push(new AccountExpiryNotificationProvider({ accountExpiry }));
+ notificationProviders.push(new AccountExpiryNotificationProvider({ accountExpiry, locale }));
}
const notificationProvider = notificationProviders.find((notification) =>