summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOliver <oliver@mohlin.dev>2025-02-20 10:25:09 +0100
committerTobias Järvelöv <tobias.jarvelov@mullvad.net>2025-05-28 10:28:14 +0200
commit1e8433700b603343244239146db81037bc8f04e0 (patch)
tree69a3faf004fad6d3a87d7b68d029f6afcc5abedf
parent3ef7ac860d2ccdda9e31127f19547bb6c96d2922 (diff)
downloadmullvadvpn-1e8433700b603343244239146db81037bc8f04e0.tar.xz
mullvadvpn-1e8433700b603343244239146db81037bc8f04e0.zip
Add dismissed update to gui settings
-rw-r--r--desktop/packages/mullvad-vpn/src/main/gui-settings.ts12
-rw-r--r--desktop/packages/mullvad-vpn/src/renderer/redux/settings/reducers.ts1
-rw-r--r--desktop/packages/mullvad-vpn/src/shared/gui-settings-state.ts4
-rw-r--r--desktop/packages/mullvad-vpn/test/e2e/setup/main.ts1
4 files changed, 18 insertions, 0 deletions
diff --git a/desktop/packages/mullvad-vpn/src/main/gui-settings.ts b/desktop/packages/mullvad-vpn/src/main/gui-settings.ts
index ae0cff0cab..85dec09c10 100644
--- a/desktop/packages/mullvad-vpn/src/main/gui-settings.ts
+++ b/desktop/packages/mullvad-vpn/src/main/gui-settings.ts
@@ -14,6 +14,7 @@ const settingsSchema: Record<keyof IGuiSettingsState, string> = {
unpinnedWindow: 'boolean',
browsedForSplitTunnelingApplications: 'Array<string>',
changelogDisplayedForVersion: 'string',
+ updateDismissedForVersion: 'string',
animateMap: 'boolean',
};
@@ -26,6 +27,7 @@ const defaultSettings: IGuiSettingsState = {
unpinnedWindow: process.platform !== 'win32' && process.platform !== 'darwin',
browsedForSplitTunnelingApplications: [],
changelogDisplayedForVersion: '',
+ updateDismissedForVersion: '',
animateMap: true,
};
@@ -116,6 +118,16 @@ export default class GuiSettings {
: this.stateValue.changelogDisplayedForVersion;
}
+ set updateDismissedForVersion(newValue: string | undefined) {
+ this.changeStateAndNotify({ ...this.stateValue, updateDismissedForVersion: newValue ?? '' });
+ }
+
+ get updateDismissedForVersion(): string | undefined {
+ return this.stateValue.updateDismissedForVersion === ''
+ ? undefined
+ : this.stateValue.updateDismissedForVersion;
+ }
+
set animateMap(newValue: boolean) {
this.changeStateAndNotify({ ...this.stateValue, animateMap: newValue });
}
diff --git a/desktop/packages/mullvad-vpn/src/renderer/redux/settings/reducers.ts b/desktop/packages/mullvad-vpn/src/renderer/redux/settings/reducers.ts
index 1540179289..909004faf6 100644
--- a/desktop/packages/mullvad-vpn/src/renderer/redux/settings/reducers.ts
+++ b/desktop/packages/mullvad-vpn/src/renderer/redux/settings/reducers.ts
@@ -134,6 +134,7 @@ const initialState: ISettingsReduxState = {
unpinnedWindow: window.env.platform !== 'win32' && window.env.platform !== 'darwin',
browsedForSplitTunnelingApplications: [],
changelogDisplayedForVersion: '',
+ updateDismissedForVersion: '',
animateMap: true,
},
relaySettings: {
diff --git a/desktop/packages/mullvad-vpn/src/shared/gui-settings-state.ts b/desktop/packages/mullvad-vpn/src/shared/gui-settings-state.ts
index 68e958324a..9339541042 100644
--- a/desktop/packages/mullvad-vpn/src/shared/gui-settings-state.ts
+++ b/desktop/packages/mullvad-vpn/src/shared/gui-settings-state.ts
@@ -32,6 +32,10 @@ export interface IGuiSettingsState {
// changelog after upgrade.
changelogDisplayedForVersion: string;
+ // The last version that the update dialog was dismissed for. This is used to determine
+ // whether to show the update notification.
+ updateDismissedForVersion: string;
+
// Tells the app whether or not to show the map in the main view.
animateMap: boolean;
}
diff --git a/desktop/packages/mullvad-vpn/test/e2e/setup/main.ts b/desktop/packages/mullvad-vpn/test/e2e/setup/main.ts
index 700c71c5a5..d23d85cfa6 100644
--- a/desktop/packages/mullvad-vpn/test/e2e/setup/main.ts
+++ b/desktop/packages/mullvad-vpn/test/e2e/setup/main.ts
@@ -29,6 +29,7 @@ class ApplicationMain {
unpinnedWindow: process.platform !== 'win32' && process.platform !== 'darwin',
browsedForSplitTunnelingApplications: [],
changelogDisplayedForVersion: '',
+ updateDismissedForVersion: '',
animateMap: true,
};