11import { createSignal , Show } from "solid-js" ;
22import { useNavigate } from "@solidjs/router" ;
33import { user , clearAuth } from "../../stores/auth" ;
4- import { getCoreRateLimit , getSearchRateLimit } from "../../services/github" ;
4+ import { getCoreRateLimit , getGraphqlRateLimit } from "../../services/github" ;
55import { getUnreadCount , markAllAsRead } from "../../lib/errors" ;
66import NotificationDrawer from "../shared/NotificationDrawer" ;
77import ToastContainer from "../shared/ToastContainer" ;
@@ -27,7 +27,7 @@ export default function Header() {
2727 const unreadCount = ( ) => getUnreadCount ( ) ;
2828
2929 const coreRL = ( ) => getCoreRateLimit ( ) ;
30- const searchRL = ( ) => getSearchRateLimit ( ) ;
30+ const graphqlRL = ( ) => getGraphqlRateLimit ( ) ;
3131
3232 function formatLimit ( remaining : number , limit : number , unit : string ) : string {
3333 const k = limit >= 1000 ? `${ limit / 1000 } k` : String ( limit ) ;
@@ -43,7 +43,7 @@ export default function Header() {
4343
4444 < div class = "flex-1" />
4545
46- < Show when = { coreRL ( ) || searchRL ( ) } >
46+ < Show when = { coreRL ( ) || graphqlRL ( ) } >
4747 < div class = "flex items-center gap-2 shrink-0" >
4848 < span class = "text-xs font-medium text-gray-400 dark:text-gray-500" > Rate Limits</ span >
4949 < div class = "flex flex-col items-end text-xs tabular-nums leading-tight gap-0.5" >
@@ -57,13 +57,13 @@ export default function Header() {
5757 </ span >
5858 ) }
5959 </ Show >
60- < Show when = { searchRL ( ) } >
60+ < Show when = { graphqlRL ( ) } >
6161 { ( rl ) => (
6262 < span
63- class = { rl ( ) . remaining < 5 ? "text-amber-600 dark:text-amber-400" : "text-gray-500 dark:text-gray-400" }
64- title = { `Search rate limit resets at ${ rl ( ) . resetAt . toLocaleTimeString ( ) } ` }
63+ class = { rl ( ) . remaining < 500 ? "text-amber-600 dark:text-amber-400" : "text-gray-500 dark:text-gray-400" }
64+ title = { `GraphQL rate limit resets at ${ rl ( ) . resetAt . toLocaleTimeString ( ) } ` }
6565 >
66- { formatLimit ( rl ( ) . remaining , 30 , "min " ) }
66+ GraphQL { formatLimit ( rl ( ) . remaining , 5000 , "hr " ) }
6767 </ span >
6868 ) }
6969 </ Show >
0 commit comments