File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import Head from "@docusaurus/Head";
9
9
import ReactMarkdown from "react-markdown" ;
10
10
import { GoogleAd } from "../../components/GoogleAd" ;
11
11
import useIsBrowser from "@docusaurus/useIsBrowser" ;
12
+ import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment" ;
12
13
13
14
const releaseTableColumns = [
14
15
{
@@ -132,6 +133,9 @@ export default function Downloads() {
132
133
fetchLatestReleases ( ) ;
133
134
} , [ ] ) ;
134
135
136
+ if ( ! ExecutionEnvironment . canUseDOM ) {
137
+ return < > </ > ;
138
+ }
135
139
return (
136
140
< Layout
137
141
title = "Downloads"
@@ -223,6 +227,11 @@ export default function Downloads() {
223
227
< div className = "flex items-center font-bold" >
224
228
< Switch
225
229
color = "primary"
230
+ defaultSelected = {
231
+ window . localStorage . getItem (
232
+ "downloads-showPreviousStables" ,
233
+ ) === "true"
234
+ }
226
235
checked = { showPreviousStables }
227
236
onChange = { ( e ) => {
228
237
setShowPreviousStables ( e . target . checked ) ;
@@ -323,6 +332,11 @@ export default function Downloads() {
323
332
< div className = "flex items-center font-bold" >
324
333
< Switch
325
334
color = "warning"
335
+ defaultSelected = {
336
+ window . localStorage . getItem (
337
+ "downloads-showPreviousNightlies" ,
338
+ ) === "true"
339
+ }
326
340
checked = { showPreviousNightlies }
327
341
onChange = { ( e ) => {
328
342
setShowPreviousNightlies ( e . target . checked ) ;
You can’t perform that action at this time.
0 commit comments