Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/missing user details #1137

Merged
merged 2 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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