Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit d29b73d

Browse files
committed
fix user page
1 parent 197f8a9 commit d29b73d

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

pages/dataproduct/new.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import { useFetchUserData } from '../../lib/rest/userData'
88
const NewDataproduct = () => {
99
const userData = useFetchUserData()
1010

11-
if(!userData || userData.loading){
11+
if(!userData?.data || userData?.loading){
1212
return <LoaderSpinner />
1313
}
1414

15-
if (!userData.data?.userInfo)
15+
if (!userData?.data)
1616
return (
1717
<div>
1818
<h1>Du må være logget inn!</h1>

pages/insightProduct/new.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import { useFetchUserData } from '../../lib/rest/userData'
1010
const NewInsightProduct = () => {
1111
const userData = useFetchUserData()
1212

13-
if(!userData || userData.loading){
13+
if(!userData?.data || userData?.loading){
1414
return <LoaderSpinner />
1515
}
1616

17-
if (!userData.data?.userInfo)
17+
if (!userData?.data)
1818
return (
1919
<div>
2020
<h1>Du må være logget inn!</h1>

pages/story/new.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import { useFetchUserData } from '../../lib/rest/userData'
88
const NewStory = () => {
99
const userData = useFetchUserData()
1010

11-
if(!userData || userData.loading){
11+
if(!userData?.data || userData?.loading){
1212
return <LoaderSpinner />
1313
}
1414

15-
if (!userData.data?.userInfo)
15+
if (!userData?.data)
1616
return (
1717
<div>
1818
<h1>Du må være logget inn!</h1>

pages/user/[[...page]].tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ export const UserPages = () => {
1818

1919
if (error) return <ErrorMessage error={error} />
2020
if (loading || !data) return <LoaderSpinner />
21-
22-
if(loading){
23-
return <LoaderSpinner />
24-
}
25-
21+
2622
if (!data)
2723
return (
2824
<div>

0 commit comments

Comments
 (0)