Skip to content

Commit 0e7fae6

Browse files
Update useLatestVersion in autostart options when user pref updaetd (#19181)
* update useLatestVersion in autostart options * avoid mutating user directly
1 parent d447212 commit 0e7fae6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

components/dashboard/src/user-settings/SelectIDE.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,26 @@ export default function SelectIDE(props: SelectIDEProps) {
3737
const additionalData = user?.additionalData || {};
3838
const ideSettings = additionalData.ideSettings || {};
3939

40+
// update stored autostart options to match useLatestVersion value set here
41+
const workspaceAutostartOptions = additionalData?.workspaceAutostartOptions?.map((option) => {
42+
if (option.ideSettings) {
43+
const newOption = {
44+
...option,
45+
ideSettings: {
46+
...option.ideSettings,
47+
useLatestVersion,
48+
},
49+
};
50+
return newOption;
51+
}
52+
53+
return option;
54+
});
55+
4056
const updates = {
4157
additionalData: {
4258
...additionalData,
59+
workspaceAutostartOptions,
4360
ideSettings: {
4461
...ideSettings,
4562
settingVersion: "2.0",

0 commit comments

Comments
 (0)