From a487bc860d4ed2b9583bfcfa88eca611c3037470 Mon Sep 17 00:00:00 2001 From: Kristofer Date: Fri, 18 Aug 2023 11:20:39 +0200 Subject: [PATCH 1/2] Get user details with id, not username --- packages/frontend/src/model/user/users.ts | 4 +--- packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/model/user/users.ts b/packages/frontend/src/model/user/users.ts index b594c8d46..d1269307f 100644 --- a/packages/frontend/src/model/user/users.ts +++ b/packages/frontend/src/model/user/users.ts @@ -305,10 +305,8 @@ const DetailedSingleUserQuery = selectorFamily({ * Update user cached in global state. */ export const useLoadSingleUserDetails = ( - username: string + userId?: string ): AxiosResponse | AxiosError | undefined => { - const userId = useRecoilValue(SingleUser(username))?._id; - const response = useRecoilValue(DetailedSingleUserQuery(userId)); const user = useRecoilValue(SingleUser(userId)); const setUser = useSetRecoilState(SingleUser(userId)); diff --git a/packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx b/packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx index e08eef164..3d58b0181 100644 --- a/packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx +++ b/packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx @@ -29,8 +29,8 @@ const UserDetailsPage = (): JSX.Element | null => { const dialogRef = React.useRef(null); const { userName } = useParams(); - useLoadSingleUserDetails(userName); const user = useRecoilValue(SingleUserByUsername(userName)); + useLoadSingleUserDetails(user?._id); const [isDialogOpen, setIsDialogOpen] = React.useState(false); From c1f868a7edd3c296a9fe893e99b912d0056aab57 Mon Sep 17 00:00:00 2001 From: Kristofer Date: Fri, 18 Aug 2023 11:20:47 +0200 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4fcc5df3..9a61634ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,11 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- **Frontend**: Custom reporst can now be confihured using an interactive form. #1131 +- **Frontend**: Custom reports can now be configured using an interactive form. #1131 - **Frontend**: New feature: Run custom reports from the reports page. #1050 ### Fixed +- **Frontend**: Fix bug that caused praise score details etc go missing from the user details page. - **API:** Praise now allows for usernames that are two characters to align with Discord requirements #1132 - **Frontend:** JWT token is now refreshed when it expires. If the refresh token has expired as well, user has to login again. #1120 - **Frontend:** Fix styling bug that caused the login button to be hidden on short screens. #1107