Commit a3198f1 1 parent a41aaeb commit a3198f1 Copy full SHA for a3198f1
File tree 3 files changed +28
-3
lines changed
3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export default function CreateBasePlanetSector() {
29
29
}
30
30
} catch ( error ) {
31
31
console . error ( error . message ) ;
32
- }
32
+ } ;
33
33
} ;
34
34
35
35
fetchUserPlanet ( ) ;
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ export const UserDropdownMenu = ({ user } : { user: string }) => {
157
157
. then ( ( result ) => {
158
158
if ( result . data ) {
159
159
setProfile ( result . data [ 0 ] ) ;
160
- }
160
+ } ;
161
161
} ) ;
162
162
} , [ session ] ) ;
163
163
Original file line number Diff line number Diff line change @@ -37,18 +37,43 @@ export function PublicLanding() {
37
37
/>
38
38
) ;
39
39
40
+ // User data config
40
41
const session = useSession ( ) ;
42
+ const supabase = useSupabaseClient ( ) ;
43
+ const [ profile , setProfile ] = useState < any > ( null ) ;
44
+ useEffect ( ( ) => {
45
+ supabase . from ( "profiles" )
46
+ . select ( )
47
+ . eq ( "id" , session ?. user ?. id )
48
+ . then ( ( result ) => {
49
+ if ( result . data ) {
50
+ setProfile ( result . data [ 0 ] ) ;
51
+ } ;
52
+ } ) ;
53
+ } , [ session , supabase ] ) ;
54
+ useEffect ( ( ) => {
55
+ if ( profile ) {
56
+ console . log ( profile . location ?? "Location not available" ) ;
57
+ } ;
58
+ } , [ profile ] ) ;
41
59
42
60
// Component context
43
61
const [ showFeedOverlay , setShowFeedOverlay ] = useState ( false ) ;
44
62
const handleOpenFeedOverlay = ( ) => {
45
63
setShowFeedOverlay ( true ) ;
46
64
} ;
47
65
66
+ // Screen size parameters
48
67
const isDesktopOrLaptop = useMediaQuery ( { query : '(min-width: 1224px)' } ) ;
49
68
const isTabletOrMobile = useMediaQuery ( { query : '(max-width: 1224px)' } ) ;
50
69
51
- if ( session ) {
70
+ if ( session && ! profile ?. location ) {
71
+ return (
72
+ < p > Location</ p >
73
+ ) ;
74
+ } ;
75
+
76
+ if ( session && profile ?. location ) {
52
77
return (
53
78
< LayoutNoNav >
54
79
< Navigation />
You canβt perform that action at this time.
0 commit comments