File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export type HomePageFeedUpdateType = {
3131}
3232
3333export default function Home ( ) {
34- const [ session ] = useSession ( )
34+ const [ session , loading ] = useSession ( )
3535
3636 const { isLoading, isError, data } = useQuery < {
3737 updates : HomePageFeedUpdateType [ ]
@@ -57,6 +57,10 @@ export default function Home() {
5757 } )
5858 } )
5959
60+ if ( isGoalLoading || loading || isLoading ) {
61+ return < p > loading...</ p >
62+ }
63+
6064 if ( isError || isGoalError ) {
6165 return < p > Something went wrong!!!</ p >
6266 }
@@ -66,9 +70,7 @@ export default function Home() {
6670 < Title suffix = "Learn. Code. Collaborate." > Coderplex Community</ Title >
6771 < HomePageFeed
6872 updates = { data ?. updates ?? [ ] }
69- showGoal = { Boolean (
70- ! isGoalLoading && ! isGoalError && session && goalData ?. goal
71- ) }
73+ showGoal = { Boolean ( session && goalData ?. goal ) }
7274 goal = { goalData ?. goal }
7375 />
7476 </ >
You can’t perform that action at this time.
0 commit comments