]> Untitled Git - lemmy-ui.git/commitdiff
Merge branch 'main' into main
authorIvo Barros <L3v3L@users.noreply.github.com>
Wed, 21 Jun 2023 19:45:58 +0000 (20:45 +0100)
committerGitHub <noreply@github.com>
Wed, 21 Jun 2023 19:45:58 +0000 (20:45 +0100)
1  2 
src/shared/utils.ts

diff --combined src/shared/utils.ts
index d6946ccea75db310b726c79d7b23b30198793ac1,33658d170d4813ca3d013d0fa7e7d0a40ef88574..d42243d6ff82ca569ffd50597b9428a181d70b52
@@@ -65,10 -65,10 +65,10 @@@ export const favIconPngUrl = "/static/a
  export const repoUrl = "https://github.com/LemmyNet";
  export const joinLemmyUrl = "https://join-lemmy.org";
  export const donateLemmyUrl = `${joinLemmyUrl}/donate`;
- export const docsUrl = `${joinLemmyUrl}/docs/en/index.html`;
- export const helpGuideUrl = `${joinLemmyUrl}/docs/en/users/01-getting-started.html`; // TODO find a way to redirect to the non-en folder
- export const markdownHelpUrl = `${joinLemmyUrl}/docs/en/users/02-media.html`;
- export const sortingHelpUrl = `${joinLemmyUrl}/docs/en/users/03-votes-and-ranking.html`;
+ export const docsUrl = `${joinLemmyUrl}/docs/index.html`;
+ export const helpGuideUrl = `${joinLemmyUrl}/docs/users/01-getting-started.html`; // TODO find a way to redirect to the non-en folder
+ export const markdownHelpUrl = `${joinLemmyUrl}/docs/users/02-media.html`;
+ export const sortingHelpUrl = `${joinLemmyUrl}/docs/users/03-votes-and-ranking.html`;
  export const archiveTodayUrl = "https://archive.today";
  export const ghostArchiveUrl = "https://ghostarchive.org";
  export const webArchiveUrl = "https://web.archive.org";
@@@ -853,28 -853,21 +853,28 @@@ export function commentsToFlatNodes(com
  }
  
  export function convertCommentSortType(sort: SortType): CommentSortType {
 -  if (
 -    sort == "TopAll" ||
 -    sort == "TopDay" ||
 -    sort == "TopWeek" ||
 -    sort == "TopMonth" ||
 -    sort == "TopYear"
 -  ) {
 -    return "Top";
 -  } else if (sort == "New") {
 -    return "New";
 -  } else if (sort == "Hot" || sort == "Active") {
 -    return "Hot";
 -  } else {
 -    return "Hot";
 -  }
 +    switch(sort) {
 +        case "TopAll":
 +        case "TopHour":
 +        case "TopSixHour":
 +        case "TopTwelveHour":
 +        case "TopDay":
 +        case "TopWeek":
 +        case "TopMonth":
 +        case "TopYear": {
 +            return "Top";
 +        }
 +        case "New": {
 +            return "New";
 +        }
 +        case "Hot":
 +        case "Active": {
 +            return "Hot";
 +        }
 +        default: {
 +            return "Hot";
 +        }
 +    }
  }
  
  export function buildCommentsTree(