File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 11import Image from "next/image" ;
22import PublishedAt from "./publishedAt" ;
33
4+ type Asset = {
5+ browser_download_url : string ;
6+ name : string ;
7+ } ;
8+
49export default async function Home ( ) {
510 const data = await fetch (
6- "https://api.github.com/repos/Streamware/Mirrors/releases?per_page=1" ,
7- { cache : "force-cache" }
11+ "https://api.github.com/repos/Streamware/Mirrors/releases?per_page=1"
812 ) . then ( ( res ) => res . json ( ) ) ;
913
14+ const getReleaseAsset = data [ 0 ] . assets . find ( ( asset : Asset ) =>
15+ asset . name . includes ( "app-release.apk" )
16+ ) ;
17+
1018 return (
1119 < main className = "flex min-h-screen flex-col items-center sm:p-24 p-10" >
1220 < div className = "flex items-center justify-center text-[60px] rounded pointer-events-none select-none bg-[#0049FF] text-white w-24 h-24 mb-3" >
@@ -22,7 +30,7 @@ export default async function Home() {
2230 < div className = "flex-col items-center content-center justify-center my-5" >
2331 < a
2432 className = "block bg-[#171717] text-gray-100 px-4 py-2 rounded-lg text-sm mb-2"
25- href = { data [ 0 ] . assets [ 0 ] . browser_download_url }
33+ href = { getReleaseAsset . browser_download_url }
2634 download
2735 >
2836 Download APK
You can’t perform that action at this time.
0 commit comments