message: Fix a couple of `forked-to` bugs
diff: @@ -39,7 +39,7 @@ async function validateFork(repo: string): Promise<boolean> {
  return response.ok;
  }
  -async function validateForks(forks: string[]): Promise<void> {
  +async function updateForks(forks: string[]): Promise<void> {
  // Don't validate current page: it exists; it won't be shown in the list; it will be added later anyway
  const validForks = await pFilter(forks.filter(fork => fork !== getRepoURL()), validateFork);
  @@ -57,21 +57,19 @@ async function init(): Promise<void> {
  const forks = await cache.get<string[]>(getCacheKey());
  - if (!forks) {
  - return;
  - }
  -
  + if (forks) {
  const pageHeader = select('.pagehead h1.public')!;
  - for (const fork of forks) {
  + for (const fork of forks.filter(fork => fork !== getRepoURL())) {
  pageHeader.append(
  <span className="fork-flag rgh-forked">
  forked to <a href={`/${fork}`}>{fork}</a>
  </span>
  );
  }
  + }
  // Validate cache after showing links once, to make it faster
  - await validateForks(forks);
  + await updateForks(forks || []);
  }
  features.add({
  