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() {
126126 "" ;
127127
128128 const exampleUrl = `https://github.com/get-convex/better-auth/tree/${ branch || "latest" } /examples` ;
129- console . log ( "branch" , branch ) ;
130- console . log ( "exampleUrl" , exampleUrl ) ;
131129 const selectedFramework = useSelectedVariant ( "framework" ) ;
132130 return (
133131 < 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";
66import { useEffect , useRef } from "react" ;
77import localVersions from "../versions.json" ;
88
9- const channels = [ "latest" , "alpha" ] ;
10-
119const DOCS_DOMAIN = "convex-better-auth.netlify.app" ;
1210
1311type Version = {
1412 label : string ;
1513 version : string ;
14+ branch : string ;
1615} ;
1716
1817const getVersions = async ( ) => {
1918 return (
2019 await Promise . all (
21- channels . map ( async ( channel ) => {
20+ localVersions . map ( async ( version ) => {
2221 try {
2322 const versions : Version [ ] = await (
2423 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`
2625 )
2726 ) . json ( ) ;
2827 const isArray = Array . isArray ( versions ) ;
2928 if ( ! isArray ) {
3029 throw Error ( "versions is not an array" ) ;
3130 }
32- return versions . find ( ( v ) => v . label === channel ) ;
31+ return versions . find ( ( v ) => v . label === version . label ) ;
3332 } catch ( error ) {
3433 console . error ( error ) ;
3534 }
Original file line number Diff line number Diff line change 11[
22 {
33 "version" : " v0.7.14" ,
4- "label" : " latest"
4+ "label" : " latest" ,
5+ "branch" : " latest"
56 },
67 {
78 "version" : " v0.8.0-alpha.5" ,
8- "label" : " alpha"
9+ "label" : " alpha" ,
10+ "branch" : " main"
911 }
1012]
You can’t perform that action at this time.
0 commit comments