File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -126,8 +126,6 @@ export default function Home() {
126
126
"" ;
127
127
128
128
const exampleUrl = `https://github.com/get-convex/better-auth/tree/${ branch || "latest" } /examples` ;
129
- console . log ( "branch" , branch ) ;
130
- console . log ( "exampleUrl" , exampleUrl ) ;
131
129
const selectedFramework = useSelectedVariant ( "framework" ) ;
132
130
return (
133
131
< div className = "max-w-3xl mx-auto px-4 sm:px-6 md:mt-12" >
Original file line number Diff line number Diff line change @@ -6,30 +6,29 @@ import { cn } from "../lib/utils";
6
6
import { useEffect , useRef } from "react" ;
7
7
import localVersions from "../versions.json" ;
8
8
9
- const channels = [ "latest" , "alpha" ] ;
10
-
11
9
const DOCS_DOMAIN = "convex-better-auth.netlify.app" ;
12
10
13
11
type Version = {
14
12
label : string ;
15
13
version : string ;
14
+ branch : string ;
16
15
} ;
17
16
18
17
const getVersions = async ( ) => {
19
18
return (
20
19
await Promise . all (
21
- channels . map ( async ( channel ) => {
20
+ localVersions . map ( async ( version ) => {
22
21
try {
23
22
const versions : Version [ ] = await (
24
23
await fetch (
25
- `https://raw.githubusercontent.com/get-convex/better-auth/refs/heads/${ channel } /docs/versions.json`
24
+ `https://raw.githubusercontent.com/get-convex/better-auth/refs/heads/${ version . branch } /docs/versions.json`
26
25
)
27
26
) . json ( ) ;
28
27
const isArray = Array . isArray ( versions ) ;
29
28
if ( ! isArray ) {
30
29
throw Error ( "versions is not an array" ) ;
31
30
}
32
- return versions . find ( ( v ) => v . label === channel ) ;
31
+ return versions . find ( ( v ) => v . label === version . label ) ;
33
32
} catch ( error ) {
34
33
console . error ( error ) ;
35
34
}
Original file line number Diff line number Diff line change 1
1
[
2
2
{
3
3
"version" : " v0.7.14" ,
4
- "label" : " latest"
4
+ "label" : " latest" ,
5
+ "branch" : " latest"
5
6
},
6
7
{
7
8
"version" : " v0.8.0-alpha.5" ,
8
- "label" : " alpha"
9
+ "label" : " alpha" ,
10
+ "branch" : " main"
9
11
}
10
12
]
You can’t perform that action at this time.
0 commit comments