@@ -25,11 +25,9 @@ export interface TermsOfServiceProps {
25
25
}
26
26
interface TermsOfServiceState {
27
27
isUpdate : boolean ;
28
- flowId : string ;
29
28
userInfo ?: any ;
30
29
terms ?: Terms ;
31
30
acceptsTos : boolean ;
32
- submitted : boolean ;
33
31
}
34
32
export class TermsOfService extends React . Component < TermsOfServiceProps , TermsOfServiceState > {
35
33
protected gitpodHost = new GitpodHostUrl ( window . location . href ) ;
@@ -40,9 +38,7 @@ export class TermsOfService extends React.Component<TermsOfServiceProps, TermsOf
40
38
super ( props ) ;
41
39
this . state = {
42
40
isUpdate : false ,
43
- acceptsTos : false ,
44
- submitted : false ,
45
- flowId : "ignore" ,
41
+ acceptsTos : false
46
42
} ;
47
43
this . formRef = React . createRef ( ) ;
48
44
this . onDecline = this . onDecline . bind ( this ) ;
@@ -57,7 +53,6 @@ export class TermsOfService extends React.Component<TermsOfServiceProps, TermsOf
57
53
const tosHints = Cookies . getJSON ( 'tosHints' ) ;
58
54
this . setState ( {
59
55
isUpdate : tosHints ?. isUpdate === true ,
60
- flowId : typeof tosHints ?. flowId === "string" ? tosHints ?. flowId : this . state . flowId ,
61
56
userInfo : typeof tosHints ?. userInfo === "object" ? tosHints ?. userInfo : undefined
62
57
} ) ;
63
58
this . props . terms . then ( terms => this . setState ( { terms } ) ) ;
@@ -68,10 +63,10 @@ export class TermsOfService extends React.Component<TermsOfServiceProps, TermsOf
68
63
}
69
64
70
65
onAccept ( ) {
71
- this . setState ( { acceptsTos : true , submitted : true } , ( ) => this . doSubmit ( ) ) ;
66
+ this . setState ( { acceptsTos : true } , ( ) => this . doSubmit ( ) ) ;
72
67
}
73
68
onDecline ( ) {
74
- this . setState ( { acceptsTos : false , submitted : true } , ( ) => this . doSubmit ( ) ) ;
69
+ this . setState ( { acceptsTos : false } , ( ) => this . doSubmit ( ) ) ;
75
70
}
76
71
protected doSubmit ( ) {
77
72
this . formRef . current ! . submit ( ) ;
@@ -131,7 +126,6 @@ export class TermsOfService extends React.Component<TermsOfServiceProps, TermsOf
131
126
</ AppBar >
132
127
< div className = 'content content-area' >
133
128
< form ref = { this . formRef } action = { this . actionUrl } method = "post" id = "accept-tos-form" >
134
- < input type = "hidden" id = "flowId" name = "flowId" value = { this . state . flowId } />
135
129
< div className = "tos-checks" >
136
130
< Typography className = "tos-content" dangerouslySetInnerHTML = { { __html : update ? updateMessage : content } } />
137
131
< p >
@@ -154,15 +148,13 @@ export class TermsOfService extends React.Component<TermsOfServiceProps, TermsOf
154
148
variant = 'text'
155
149
color = { 'secondary' }
156
150
onClick = { this . onDecline }
157
- disabled = { this . state . submitted }
158
151
data-testid = "decline" >
159
152
{ 'Decline and log out' }
160
153
</ ButtonWithProgress >
161
154
) }
162
155
< ButtonWithProgress
163
156
className = 'button'
164
157
onClick = { this . onAccept }
165
- disabled = { this . state . submitted }
166
158
variant = 'outlined'
167
159
color = { 'primary' }
168
160
data-testid = "submit" >
0 commit comments