diff --git a/src/state/reducers/accessToken.ts b/src/state/reducers/accessToken.ts index ab559e99..180cfd42 100644 --- a/src/state/reducers/accessToken.ts +++ b/src/state/reducers/accessToken.ts @@ -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( task: (token: authApi.AccessToken) => T.Task, diff --git a/src/state/reducers/mentors.ts b/src/state/reducers/mentors.ts index 4914799c..13ac86be 100644 --- a/src/state/reducers/mentors.ts +++ b/src/state/reducers/mentors.ts @@ -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