File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export type HomePageFeedUpdateType = {
31
31
}
32
32
33
33
export default function Home ( ) {
34
- const [ session ] = useSession ( )
34
+ const [ session , loading ] = useSession ( )
35
35
36
36
const { isLoading, isError, data } = useQuery < {
37
37
updates : HomePageFeedUpdateType [ ]
@@ -57,6 +57,10 @@ export default function Home() {
57
57
} )
58
58
} )
59
59
60
+ if ( isGoalLoading || loading || isLoading ) {
61
+ return < p > loading...</ p >
62
+ }
63
+
60
64
if ( isError || isGoalError ) {
61
65
return < p > Something went wrong!!!</ p >
62
66
}
@@ -66,9 +70,7 @@ export default function Home() {
66
70
< Title suffix = "Learn. Code. Collaborate." > Coderplex Community</ Title >
67
71
< HomePageFeed
68
72
updates = { data ?. updates ?? [ ] }
69
- showGoal = { Boolean (
70
- ! isGoalLoading && ! isGoalError && session && goalData ?. goal
71
- ) }
73
+ showGoal = { Boolean ( session && goalData ?. goal ) }
72
74
goal = { goalData ?. goal }
73
75
/>
74
76
</ >
You can’t perform that action at this time.
0 commit comments