summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-04-14 13:23:02 +0200
committerOskar Nyberg <oskar@mullvad.net>2022-04-20 10:51:21 +0200
commit9a07f80b235382232ba3c3f34c83e2ce8931aaa8 (patch)
treef9a7c76076d5bb3f421b604a270ec3e28903f8d0 /gui/src/shared
parentfbdf3932b450ab65940f9f006db05cd35ff10704 (diff)
downloadmullvadvpn-9a07f80b235382232ba3c3f34c83e2ce8931aaa8.tar.xz
mullvadvpn-9a07f80b235382232ba3c3f34c83e2ce8931aaa8.zip
Remember history when replacing window
Diffstat (limited to 'gui/src/shared')
-rw-r--r--gui/src/shared/ipc-schema.ts9
-rw-r--r--gui/src/shared/ipc-types.ts8
2 files changed, 16 insertions, 1 deletions
diff --git a/gui/src/shared/ipc-schema.ts b/gui/src/shared/ipc-schema.ts
index ce517c8f21..3d08b34f48 100644
--- a/gui/src/shared/ipc-schema.ts
+++ b/gui/src/shared/ipc-schema.ts
@@ -27,7 +27,12 @@ interface ILogEntry {
message: string;
}
import { invoke, invokeSync, notifyRenderer, send } from './ipc-helpers';
-import { IChangelog, ICurrentAppVersionInfo, IWindowShapeParameters } from './ipc-types';
+import {
+ IChangelog,
+ ICurrentAppVersionInfo,
+ IHistoryObject,
+ IWindowShapeParameters,
+} from './ipc-types';
export interface ITranslations {
locale: string;
@@ -66,6 +71,7 @@ export interface IAppStateSnapshot {
windowsSplitTunnelingApplications?: IWindowsApplication[];
macOsScrollbarVisibility?: MacOsScrollbarVisibility;
changelog: IChangelog;
+ navigationHistory?: IHistoryObject;
}
// The different types of requests are:
@@ -118,6 +124,7 @@ export const ipcSchema = {
},
navigation: {
reset: notifyRenderer<void>(),
+ setHistory: send<IHistoryObject>(),
},
daemon: {
isPerformingPostUpgrade: notifyRenderer<boolean>(),
diff --git a/gui/src/shared/ipc-types.ts b/gui/src/shared/ipc-types.ts
index 0624ac95cd..27a80fda93 100644
--- a/gui/src/shared/ipc-types.ts
+++ b/gui/src/shared/ipc-types.ts
@@ -1,3 +1,5 @@
+import { Action, Location } from 'history';
+
export interface ICurrentAppVersionInfo {
gui: string;
daemon?: string;
@@ -10,3 +12,9 @@ export interface IWindowShapeParameters {
}
export type IChangelog = Array<string>;
+
+export interface IHistoryObject {
+ entries: Location<unknown>[];
+ index: number;
+ lastAction: Action;
+}