summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/redux/userinterface
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-09-24 12:02:08 +0200
committerOskar Nyberg <oskar@mullvad.net>2020-09-25 11:10:37 +0200
commitf8b9216b957d6cfef01088a4f450e3dcadcfccb7 (patch)
treea10caf64cfe9d21c07bec35cc0560af16fb384a3 /gui/src/renderer/redux/userinterface
parent49aab4d4ee473315901ea255758783c05d68cb15 (diff)
downloadmullvadvpn-f8b9216b957d6cfef01088a4f450e3dcadcfccb7.tar.xz
mullvadvpn-f8b9216b957d6cfef01088a4f450e3dcadcfccb7.zip
Reload duration since key was generated every minute and when the app is opened
Diffstat (limited to 'gui/src/renderer/redux/userinterface')
-rw-r--r--gui/src/renderer/redux/userinterface/actions.ts16
-rw-r--r--gui/src/renderer/redux/userinterface/reducers.ts5
2 files changed, 20 insertions, 1 deletions
diff --git a/gui/src/renderer/redux/userinterface/actions.ts b/gui/src/renderer/redux/userinterface/actions.ts
index 2954161f89..affd11798d 100644
--- a/gui/src/renderer/redux/userinterface/actions.ts
+++ b/gui/src/renderer/redux/userinterface/actions.ts
@@ -19,11 +19,17 @@ export interface ISetLocationScopeAction {
scope: LocationScope;
}
+export interface ISetWindowFocusedAction {
+ type: 'SET_WINDOW_FOCUSED';
+ focused: boolean;
+}
+
export type UserInterfaceAction =
| IUpdateLocaleAction
| IUpdateWindowArrowPositionAction
| IUpdateConnectionInfoOpenAction
- | ISetLocationScopeAction;
+ | ISetLocationScopeAction
+ | ISetWindowFocusedAction;
function updateLocale(locale: string): IUpdateLocaleAction {
return {
@@ -52,9 +58,17 @@ function setLocationScope(scope: LocationScope): ISetLocationScopeAction {
};
}
+function setWindowFocused(focused: boolean): ISetWindowFocusedAction {
+ return {
+ type: 'SET_WINDOW_FOCUSED',
+ focused,
+ };
+}
+
export default {
updateLocale,
updateWindowArrowPosition,
toggleConnectionPanel,
setLocationScope,
+ setWindowFocused,
};
diff --git a/gui/src/renderer/redux/userinterface/reducers.ts b/gui/src/renderer/redux/userinterface/reducers.ts
index 62231aafaf..4fef8efbfb 100644
--- a/gui/src/renderer/redux/userinterface/reducers.ts
+++ b/gui/src/renderer/redux/userinterface/reducers.ts
@@ -10,12 +10,14 @@ export interface IUserInterfaceReduxState {
arrowPosition?: number;
connectionPanelVisible: boolean;
locationScope: LocationScope;
+ windowFocused: boolean;
}
const initialState: IUserInterfaceReduxState = {
locale: 'en',
connectionPanelVisible: false,
locationScope: LocationScope.relay,
+ windowFocused: false,
};
export default function (
@@ -35,6 +37,9 @@ export default function (
case 'SET_LOCATION_SCOPE':
return { ...state, locationScope: action.scope };
+ case 'SET_WINDOW_FOCUSED':
+ return { ...state, windowFocused: action.focused };
+
default:
return state;
}