From 1a20acf7fb90f6717e8fbd0eb91e0671b069c7f1 Mon Sep 17 00:00:00 2001 From: frank-zsy Date: Fri, 29 Nov 2024 22:49:37 +0800 Subject: [PATCH] refactor: set default ranking Signed-off-by: frank-zsy --- src/pages/leaderboards/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/leaderboards/index.tsx b/src/pages/leaderboards/index.tsx index e68cf1f..e019a99 100644 --- a/src/pages/leaderboards/index.tsx +++ b/src/pages/leaderboards/index.tsx @@ -13,10 +13,9 @@ function OpenLeaderboard() { useEffect(() => { const search = new URLSearchParams(window.location.search); - const type = search.get('type'); + let type = search.get('type'); if (!type) { - alert('You need to set a leaderboard type first.'); - return; + type = 'projects'; } if (type === 'projects') { axios.get(`https://oss.open-digger.cn/leaderboards/${type}.json`).then(resp => {