Skip to content

Commit 1305ad3

Browse files
committed
Add dismissed update to gui settings
1 parent f9c44d6 commit 1305ad3

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

desktop/packages/mullvad-vpn/src/main/gui-settings.ts

+12
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const settingsSchema: Record<keyof IGuiSettingsState, string> = {
1414
unpinnedWindow: 'boolean',
1515
browsedForSplitTunnelingApplications: 'Array<string>',
1616
changelogDisplayedForVersion: 'string',
17+
updateDismissedForVersion: 'string',
1718
animateMap: 'boolean',
1819
};
1920

@@ -26,6 +27,7 @@ const defaultSettings: IGuiSettingsState = {
2627
unpinnedWindow: process.platform !== 'win32' && process.platform !== 'darwin',
2728
browsedForSplitTunnelingApplications: [],
2829
changelogDisplayedForVersion: '',
30+
updateDismissedForVersion: '',
2931
animateMap: true,
3032
};
3133

@@ -116,6 +118,16 @@ export default class GuiSettings {
116118
: this.stateValue.changelogDisplayedForVersion;
117119
}
118120

121+
set updateDismissedForVersion(newValue: string | undefined) {
122+
this.changeStateAndNotify({ ...this.stateValue, updateDismissedForVersion: newValue ?? '' });
123+
}
124+
125+
get updateDismissedForVersion(): string | undefined {
126+
return this.stateValue.updateDismissedForVersion === ''
127+
? undefined
128+
: this.stateValue.updateDismissedForVersion;
129+
}
130+
119131
set animateMap(newValue: boolean) {
120132
this.changeStateAndNotify({ ...this.stateValue, animateMap: newValue });
121133
}

desktop/packages/mullvad-vpn/src/renderer/redux/settings/reducers.ts

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ const initialState: ISettingsReduxState = {
134134
unpinnedWindow: window.env.platform !== 'win32' && window.env.platform !== 'darwin',
135135
browsedForSplitTunnelingApplications: [],
136136
changelogDisplayedForVersion: '',
137+
updateDismissedForVersion: '',
137138
animateMap: true,
138139
},
139140
relaySettings: {

desktop/packages/mullvad-vpn/src/shared/gui-settings-state.ts

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ export interface IGuiSettingsState {
3232
// changelog after upgrade.
3333
changelogDisplayedForVersion: string;
3434

35+
// The last version that the update dialog was dismissed for. This is used to determine
36+
// whether to show the update notification.
37+
updateDismissedForVersion: string;
38+
3539
// Tells the app whether or not to show the map in the main view.
3640
animateMap: boolean;
3741
}

desktop/packages/mullvad-vpn/test/e2e/setup/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class ApplicationMain {
2929
unpinnedWindow: process.platform !== 'win32' && process.platform !== 'darwin',
3030
browsedForSplitTunnelingApplications: [],
3131
changelogDisplayedForVersion: '',
32+
updateDismissedForVersion: '',
3233
animateMap: true,
3334
};
3435

0 commit comments

Comments
 (0)