Skip to content

Commit

Permalink
feat: exclude ius from mirror list
Browse files Browse the repository at this point in the history
  • Loading branch information
RalXYZ committed Aug 8, 2024
1 parent ca96c6d commit c40347e
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/components/search-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ import { Mirror } from '../types/mirror';
export default (props: { queryResults: Mirror[]; searching: boolean }) => {
const lexicoMap: { [key: string]: Mirror[] } = {};
const caps: string[] = [];
props.queryResults.forEach(mirror => {
if (mirror.id.length < 0) {
throw new Error('mirror id empty');
}
const cap = mirror.id[0].toLocaleUpperCase();
props.queryResults
.filter(mirror => mirror.id != 'ius') // FIXME: remove this after permanently remove ius
.forEach(mirror => {
if (mirror.id.length < 0) {
throw new Error('mirror id empty');
}
const cap = mirror.id[0].toLocaleUpperCase();

if (lexicoMap[cap]) {
lexicoMap[cap].push(mirror);
} else {
caps.push(cap);
lexicoMap[cap] = [mirror];
}
});
if (lexicoMap[cap]) {
lexicoMap[cap].push(mirror);
} else {
caps.push(cap);
lexicoMap[cap] = [mirror];
}
});
if (!props.searching) {
caps.sort();
}
Expand Down

0 comments on commit c40347e

Please sign in to comment.