Skip to content

Commit 77fd9d5

Browse files
committed
refactor: update contributor identification to use GitHub IDs and reset default stats
1 parent 6189ea1 commit 77fd9d5

1 file changed

Lines changed: 14 additions & 39 deletions

File tree

src/views/Home.vue

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const mobileMenuOpen = ref<boolean>(false);
2323
const activeOS = ref<string>('arch');
2424
const setupStep = ref<number>(0);
2525
const isScrolled = ref<boolean>(false);
26-
const starCount = ref<string>('160+');
27-
const contributorCount = ref<number>(5);
26+
const starCount = ref<string>('0');
27+
const contributorCount = ref<number>(0);
2828
const REPO = 'LotusInputMethod/fcitx5-lotus';
2929
3030
// --- CATPPUCCIN THEME LOGIC ---
@@ -108,8 +108,8 @@ const fetchContributors = async () => {
108108
const CACHE_TIME_KEY = 'lotus_contributors_timestamp_v2';
109109
const TWO_HOURS = 2 * 60 * 60 * 1000;
110110
111-
const specialRoles: Record<string, string> = {
112-
nhktmdzhg: 'Founder',
111+
const specialRoles: Record<number, string> = {
112+
57983253: 'Founder', // nhktmdzhg
113113
};
114114
115115
const blacklist = ['thanhpy2009', 'loccun'];
@@ -121,7 +121,6 @@ const fetchContributors = async () => {
121121
122122
if (cachedData && lastFetch && now - parseInt(lastFetch) < TWO_HOURS) {
123123
const parsed = JSON.parse(cachedData);
124-
// Filter again in case the blacklist was updated and we have stale cache
125124
const filtered = parsed.filter(
126125
(c: any) => !blacklist.includes(c.name) && !c.name.includes('[bot]'),
127126
);
@@ -135,10 +134,16 @@ const fetchContributors = async () => {
135134
136135
const data = await response.json();
137136
const fetchedContributors: Contributor[] = data
138-
.filter((item: any) => !blacklist.includes(item.login) && item.type !== 'Bot')
137+
.filter(
138+
(item: any) =>
139+
!blacklist.includes(item.login) &&
140+
item.type !== 'Bot' &&
141+
!item.login.includes('[bot]'),
142+
)
139143
.map((item: any) => ({
144+
id: item.id,
140145
name: item.login,
141-
role: specialRoles[item.login] || 'Contributor',
146+
role: specialRoles[item.id] || 'Contributor',
142147
avatar: item.avatar_url,
143148
githubUrl: item.html_url,
144149
}));
@@ -322,43 +327,13 @@ const typingModes: TypingMode[] = [
322327
];
323328
324329
interface Contributor {
330+
id: number;
325331
name: string;
326332
role: string;
327333
avatar: string;
328334
githubUrl: string;
329335
}
330-
const contributors = ref<Contributor[]>([
331-
{
332-
name: 'Nguyen Hoang Ky',
333-
role: 'Founder',
334-
avatar: 'https://avatars.githubusercontent.com/u/57983253?v=4',
335-
githubUrl: 'https://github.com/khog9',
336-
},
337-
{
338-
name: 'Huỳnh Thiện Lộc',
339-
role: 'Contributor',
340-
avatar: 'https://avatars.githubusercontent.com/u/148019203?v=4',
341-
githubUrl: 'https://github.com/hthienloc',
342-
},
343-
{
344-
name: 'Nguyễn Hồng Hiệp',
345-
role: 'Contributor',
346-
avatar: 'https://avatars.githubusercontent.com/u/57614330?v=4',
347-
githubUrl: 'https://github.com/Hiep-N',
348-
},
349-
{
350-
name: 'Đặng Quang Hiển',
351-
role: 'Contributor',
352-
avatar: 'https://avatars.githubusercontent.com/u/83270073?v=4',
353-
githubUrl: 'https://github.com/dqhien',
354-
},
355-
{
356-
name: 'Zebra2711',
357-
role: 'Contributor',
358-
avatar: 'https://avatars.githubusercontent.com/u/89755535?v=4',
359-
githubUrl: 'https://github.com/Zebra2711',
360-
},
361-
]);
336+
const contributors = ref<Contributor[]>([]);
362337
363338
// --- COMMANDS ---
364339
const commands: Record<string, string> = {

0 commit comments

Comments
 (0)