@@ -63,10 +63,20 @@ function App() {
63
63
}
64
64
updateTheme ( ) ;
65
65
const mediaQuery = window . matchMedia ( "(prefers-color-scheme: dark)" ) ;
66
- mediaQuery . addEventListener ( 'change' , updateTheme ) ;
66
+ if ( mediaQuery instanceof EventTarget ) {
67
+ mediaQuery . addEventListener ( 'change' , updateTheme ) ;
68
+ } else {
69
+ // backward compatibility for Safari < 14
70
+ ( mediaQuery as MediaQueryList ) . addListener ( updateTheme ) ;
71
+ }
67
72
window . addEventListener ( 'storage' , updateTheme ) ;
68
73
return function cleanup ( ) {
69
- mediaQuery . removeEventListener ( 'change' , updateTheme ) ;
74
+ if ( mediaQuery instanceof EventTarget ) {
75
+ mediaQuery . removeEventListener ( 'change' , updateTheme ) ;
76
+ } else {
77
+ // backward compatibility for Safari < 14
78
+ ( mediaQuery as MediaQueryList ) . removeListener ( updateTheme ) ;
79
+ }
70
80
window . removeEventListener ( 'storage' , updateTheme ) ;
71
81
}
72
82
} , [ localStorage . theme ] ) ;
@@ -79,7 +89,7 @@ function App() {
79
89
}
80
90
if ( window . location . pathname . startsWith ( '/blocked' ) ) {
81
91
return < div className = "mt-48 text-center" >
82
- < img src = { gitpodIcon } className = "h-16 mx-auto" />
92
+ < img src = { gitpodIcon } className = "h-16 mx-auto" />
83
93
< h1 className = "mt-12 text-gray-500 text-3xl" > Your account has been blocked.</ h1 >
84
94
< p className = "mt-4 mb-8 text-lg w-96 mx-auto" > Please contact support if you think this is an error. See also < a className = "hover:text-blue-600 dark:hover:text-blue-400" href = "https://www.gitpod.io/terms/" > terms of service</ a > .</ p >
85
95
< a className = "mx-auto" href = "mailto:[email protected] ?Subject=Blocked" > < button className = "secondary" > Contact Support
</ button > </ a >
@@ -116,19 +126,19 @@ function App() {
116
126
< Route path = "/admin/workspaces" component = { WorkspacesSearch } />
117
127
118
128
< Route path = { [ "/" , "/login" ] } exact >
119
- < Redirect to = "/workspaces" />
129
+ < Redirect to = "/workspaces" />
120
130
</ Route >
121
131
< Route path = { [ "/settings" ] } exact >
122
- < Redirect to = "/account" />
132
+ < Redirect to = "/account" />
123
133
</ Route >
124
134
< Route path = { [ "/access-control" ] } exact >
125
- < Redirect to = "/integrations" />
135
+ < Redirect to = "/integrations" />
126
136
</ Route >
127
137
< Route path = { [ "/subscription" , "/usage" , "/upgrade-subscription" ] } exact >
128
- < Redirect to = "/plans" />
138
+ < Redirect to = "/plans" />
129
139
</ Route >
130
140
< Route path = { [ "/admin" ] } exact >
131
- < Redirect to = "/admin/users" />
141
+ < Redirect to = "/admin/users" />
132
142
</ Route >
133
143
< Route path = "/sorry" exact >
134
144
< div className = "mt-48 text-center" >
@@ -171,7 +181,7 @@ function getURLHash() {
171
181
}
172
182
173
183
const renderMenu = ( user ?: User ) => {
174
- const left = [
184
+ const left = [
175
185
{
176
186
title : 'Workspaces' ,
177
187
link : '/workspaces' ,
0 commit comments