@@ -11,14 +11,15 @@ import { PageWithSettingsSubMenu } from "./PageWithSettingsSubMenu";
11
11
import { ThemeSelector } from "../components/ThemeSelector" ;
12
12
import Alert from "../components/Alert" ;
13
13
import { Link } from "react-router-dom" ;
14
- import { Heading2 , Subheading } from "../components/typography/headings" ;
14
+ import { Heading2 , Heading3 , Subheading } from "../components/typography/headings" ;
15
15
import { useUserMaySetTimeout } from "../data/current-user/may-set-timeout-query" ;
16
16
import { Button } from "../components/Button" ;
17
17
import SelectIDE from "./SelectIDE" ;
18
18
import { InputField } from "../components/forms/InputField" ;
19
19
import { TextInput } from "../components/forms/TextInputField" ;
20
20
import { useToast } from "../components/toasts/Toasts" ;
21
21
import { useUpdateCurrentUserDotfileRepoMutation } from "../data/current-user/update-mutation" ;
22
+ import { AdditionalUserData } from "@gitpod/gitpod-protocol" ;
22
23
23
24
export type IDEChangedTrackLocation = "workspace_list" | "workspace_start" | "preferences" ;
24
25
@@ -67,12 +68,22 @@ export default function Preferences() {
67
68
[ toast , setUser , workspaceTimeout ] ,
68
69
) ;
69
70
71
+ const clearAutostartWorkspaceOptions = useCallback ( async ( ) => {
72
+ if ( ! user ) {
73
+ return ;
74
+ }
75
+ AdditionalUserData . set ( user , { workspaceAutostartOptions : [ ] } ) ;
76
+ setUser ( user ) ;
77
+ await getGitpodService ( ) . server . updateLoggedInUser ( user ) ;
78
+ toast ( "Your autostart options were cleared." ) ;
79
+ } , [ setUser , toast , user ] ) ;
80
+
70
81
return (
71
82
< div >
72
83
< PageWithSettingsSubMenu >
73
- < Heading2 > Editor </ Heading2 >
84
+ < Heading2 > New Workspaces </ Heading2 >
74
85
< Subheading >
75
- Choose the editor for opening workspaces .{ " " }
86
+ Choose your default editor .{ " " }
76
87
< a
77
88
className = "gp-link"
78
89
href = "https://www.gitpod.io/docs/references/ides-and-editors"
@@ -83,6 +94,11 @@ export default function Preferences() {
83
94
</ a >
84
95
</ Subheading >
85
96
< SelectIDE location = "preferences" />
97
+ < Heading3 className = "mt-12" > Autostart Options</ Heading3 >
98
+ < Subheading > Forget any saved autostart options for all repositories.</ Subheading >
99
+ < Button className = "mt-4" type = "secondary" onClick = { clearAutostartWorkspaceOptions } >
100
+ Reset Options
101
+ </ Button >
86
102
87
103
< ThemeSelector className = "mt-12" />
88
104
0 commit comments