Skip to content

Commit

Permalink
revert "add projects sorting in the sidenav"
Browse files Browse the repository at this point in the history
This reverts commit 2a48891
  • Loading branch information
andreymikhadyuk committed Oct 17, 2023
1 parent 2a48891 commit 8b89853
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/store/states/commonLayout/saga/getProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { selectUser } from "@/pages/Auth/store/selectors";
import { CommonService, GovernanceService, ProjectService } from "@/services";
import { Awaited } from "@/shared/interfaces";
import { User } from "@/shared/models";
import { compareCommonsByLastActivity, isError } from "@/shared/utils";
import { isError } from "@/shared/utils";
import { ProjectsStateItem } from "../../projects";
import * as actions from "../actions";
import { getPermissionsDataByAllUserCommonMemberInfo } from "./utils";
Expand Down Expand Up @@ -48,19 +48,17 @@ export function* getProjects(
userCommonIds,
permissionsData,
);
const projectsData: ProjectsStateItem[] = data
.sort((prevItem, nextItem) =>
compareCommonsByLastActivity(prevItem.common, nextItem.common),
)
.map(({ common, hasMembership, hasPermissionToAddProject }) => ({
const projectsData: ProjectsStateItem[] = data.map(
({ common, hasMembership, hasPermissionToAddProject }) => ({
commonId: common.id,
image: common.image,
name: common.name,
directParent: common.directParent,
hasMembership,
hasPermissionToAddProject,
notificationsAmount: 0,
}));
}),
);

yield put(actions.getProjects.success(projectsData));
} catch (error) {
Expand Down

0 comments on commit 8b89853

Please sign in to comment.