Skip to content

Commit

Permalink
Merge pull request #1137 from givepraise/fix/missing-user-details
Browse files Browse the repository at this point in the history
Fix/missing user details
  • Loading branch information
kristoferlund authored Aug 18, 2023
2 parents fb29d05 + c1f868a commit deb7148
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions packages/frontend/src/model/user/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,8 @@ const DetailedSingleUserQuery = selectorFamily({
* Update user cached in global state.
*/
export const useLoadSingleUserDetails = (
username: string
userId?: string
): AxiosResponse<User> | AxiosError | undefined => {
const userId = useRecoilValue(SingleUser(username))?._id;

const response = useRecoilValue(DetailedSingleUserQuery(userId));
const user = useRecoilValue(SingleUser(userId));
const setUser = useSetRecoilState(SingleUser(userId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const UserDetailsPage = (): JSX.Element | null => {
const dialogRef = React.useRef(null);
const { userName } = useParams<SingleUserByUsernameParams>();

useLoadSingleUserDetails(userName);
const user = useRecoilValue(SingleUserByUsername(userName));
useLoadSingleUserDetails(user?._id);

const [isDialogOpen, setIsDialogOpen] = React.useState<boolean>(false);

Expand Down

0 comments on commit deb7148

Please sign in to comment.