@@ -4,7 +4,6 @@ interface Stats {
44 version : string ;
55 downloads : string ;
66 stars : number ;
7- phUpvotes : number ;
87 loading : boolean ;
98}
109
@@ -58,7 +57,6 @@ export function useStats(): Stats {
5857 version : '1.9.0' ,
5958 downloads : '2.4k' ,
6059 stars : 66 ,
61- phUpvotes : 0 ,
6260 loading : true ,
6361 } ) ;
6462
@@ -71,19 +69,13 @@ export function useStats(): Stats {
7169
7270 async function fetchStats ( ) : Promise < void > {
7371 try {
74- const [ npmResponse , githubResponse , phResponse ] = await Promise . allSettled ( [
72+ const [ npmResponse , githubResponse ] = await Promise . allSettled ( [
7573 fetch ( 'https://api.npmjs.org/downloads/point/last-month/skillkit' ) ,
7674 fetch ( 'https://api.github.com/repos/rohitg00/skillkit' ) ,
77- fetch ( 'https://api.producthunt.com/v2/api/graphql' , {
78- method : 'POST' ,
79- headers : { 'Content-Type' : 'application/json' } ,
80- body : JSON . stringify ( { query : '{ post(slug: "skillkit-2") { votesCount } }' } ) ,
81- } ) ,
8275 ] ) ;
8376
8477 let downloads = '2.4k' ;
8578 let stars = 66 ;
86- let phUpvotes = 0 ;
8779 let version = '1.9.0' ;
8880
8981 if ( npmResponse . status === 'fulfilled' && npmResponse . value . ok ) {
@@ -100,18 +92,6 @@ export function useStats(): Stats {
10092 }
10193 }
10294
103- if ( phResponse . status === 'fulfilled' && phResponse . value . ok ) {
104- try {
105- const phData = await phResponse . value . json ( ) ;
106- const votes = phData ?. data ?. post ?. votesCount ;
107- if ( typeof votes === 'number' && Number . isFinite ( votes ) ) {
108- phUpvotes = votes ;
109- }
110- } catch {
111- // PH API may require auth, fall back silently
112- }
113- }
114-
11595 try {
11696 const registryResponse = await fetch ( 'https://registry.npmjs.org/skillkit/latest' ) ;
11797 if ( registryResponse . ok ) {
@@ -124,7 +104,7 @@ export function useStats(): Stats {
124104 // Use default version
125105 }
126106
127- const newStats = { version, downloads, stars, phUpvotes } ;
107+ const newStats = { version, downloads, stars } ;
128108 setCachedStats ( newStats ) ;
129109 setStats ( { ...newStats , loading : false } ) ;
130110 } catch {
0 commit comments