File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed
site/src/pages/CreateWorkspacePage Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,26 @@ const CreateWorkspaceExperimentRouter: FC = () => {
30
30
templateQuery . data . id ,
31
31
"optOut" ,
32
32
] ,
33
- queryFn : ( ) => ( {
34
- templateId : templateQuery . data . id ,
35
- optedOut :
36
- localStorage . getItem ( optOutKey ( templateQuery . data . id ) ) === "true" ,
37
- } ) ,
33
+ queryFn : ( ) => {
34
+ const templateId = templateQuery . data . id ;
35
+ const localStorageKey = optOutKey ( templateId ) ;
36
+ const storedOptOutString = localStorage . getItem ( localStorageKey ) ;
37
+
38
+ let optOutResult : boolean ;
39
+
40
+ if ( storedOptOutString !== null ) {
41
+ optOutResult = storedOptOutString === "true" ;
42
+ } else {
43
+ optOutResult = Boolean (
44
+ templateQuery . data . use_classic_parameter_flow ,
45
+ ) ;
46
+ }
47
+
48
+ return {
49
+ templateId : templateId ,
50
+ optedOut : optOutResult ,
51
+ } ;
52
+ } ,
38
53
}
39
54
: { enabled : false } ,
40
55
) ;
You can’t perform that action at this time.
0 commit comments