Skip to content

Commit

Permalink
Improve codestyle, more fpts
Browse files Browse the repository at this point in the history
  • Loading branch information
rottabonus committed Nov 4, 2023
1 parent bc1d91e commit a42e7d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/state/reducers/accessToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ export const isMentor = flow(
O.toUndefined,
id => !!id,
);
export const isMe = (mentorId: string) => (appState: AppState) => {
const userId = getUserId(appState);
return userId === mentorId;
};

export const isMe = (mentorId: string) => (appState: AppState) =>
pipe(getUserId(appState), compareIds(mentorId));

const compareIds = (mentorId: string) => (userId: string | undefined) =>
mentorId === userId;

export function withToken<A>(
task: (token: authApi.AccessToken) => T.Task<A>,
Expand Down
2 changes: 1 addition & 1 deletion src/state/reducers/mentors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const withVacationing =

export const selectMentorList = (appState: types.AppState) => {
const remoteMentors = get(appState);
const { skillFilter, shouldHideInactiveMentors } = appState['filterMentors'];
const { skillFilter, shouldHideInactiveMentors } = appState.filterMentors;

return RD.remoteData.map(remoteMentors, mentors =>
mentors
Expand Down

0 comments on commit a42e7d2

Please sign in to comment.