Skip to content

Commit

Permalink
LoadSingleUserDetails afterwards
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyvy-vi committed Aug 8, 2023
1 parent 2aa6f88 commit 0b0075a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ const UserDetailsPage = (): JSX.Element | null => {
const dialogRef = React.useRef(null);
const { userName } = useParams<SingleUserByUsernameParams>();

useLoadSingleUserDetails(userName);
const user = useRecoilValue(SingleUserByUsername(userName));

if (!user) return null;

Check failure on line 35 in packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx

View workflow job for this annotation

GitHub Actions / Build & Lint

Delete `··`

Check failure on line 35 in packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx

View workflow job for this annotation

GitHub Actions / Build & Lint

Trailing spaces not allowed
useLoadSingleUserDetails(user?._id);

Check failure on line 36 in packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx

View workflow job for this annotation

GitHub Actions / Build & Lint

React Hook "useLoadSingleUserDetails" is called conditionally. React Hooks must be called in the exact same order in every component render

Check failure on line 37 in packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx

View workflow job for this annotation

GitHub Actions / Build & Lint

Delete `⏎··`

Check failure on line 38 in packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx

View workflow job for this annotation

GitHub Actions / Build & Lint

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

Check failure on line 39 in packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx

View workflow job for this annotation

GitHub Actions / Build & Lint

React Hook "React.useState" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?

const pageViews = {
Expand All @@ -41,8 +45,6 @@ const UserDetailsPage = (): JSX.Element | null => {

const [view, setView] = useState<number>(pageViews.receivedPraiseView);

Check failure on line 46 in packages/frontend/src/pages/UserDetails/UserDetailsPage.tsx

View workflow job for this annotation

GitHub Actions / Build & Lint

React Hook "useState" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?

if (!user) return null;

return (
<Page>
<BreadCrumb name="Profile" icon={faUser} />
Expand Down

0 comments on commit 0b0075a

Please sign in to comment.