@@ -9,22 +9,21 @@ import toast from "react-hot-toast";
99import { deleteAccount } from "web/lib/util/delete" ;
1010import router from "next/router" ;
1111import { Button } from "web/components/buttons/button" ;
12- import { getAuth , sendEmailVerification , sendPasswordResetEmail , User } from 'firebase/auth' ;
12+ import { getAuth , sendEmailVerification , sendPasswordResetEmail } from 'firebase/auth' ;
1313import { auth } from "web/lib/firebase/users" ;
1414import { NotificationSettings } from "web/components/notifications" ;
1515import ThemeIcon from "web/components/theme-icon" ;
16+ import { CompassLoadingIndicator } from "web/components/widgets/loading-indicator" ;
1617
1718export default function NotificationsPage ( ) {
1819 useRedirectIfSignedOut ( )
19- const privateUser = usePrivateUser ( )
20- const user = auth . currentUser
2120 return (
2221 < PageBase trackPageView = { 'settings page' } className = { 'mx-4' } >
2322 < NoSEO />
2423 < Title > Settings</ Title >
2524 < UncontrolledTabs
2625 tabs = { [
27- { title : 'General' , content : < GeneralSettings privateUser = { privateUser } user = { user } /> } ,
26+ { title : 'General' , content : < GeneralSettings /> } ,
2827 { title : 'Notifications' , content : < NotificationSettings /> } ,
2928 ] }
3029 trackingName = { 'settings page' }
@@ -33,12 +32,18 @@ export default function NotificationsPage() {
3332 )
3433}
3534
36- const GeneralSettings = ( props : {
37- privateUser : PrivateUser | null | undefined ,
38- user : User | null ,
35+ export const GeneralSettings = ( ) => {
36+ const privateUser = usePrivateUser ( )
37+ if ( ! privateUser ) return < CompassLoadingIndicator />
38+ return < LoadedGeneralSettings privateUser = { privateUser } />
39+ }
40+
41+ const LoadedGeneralSettings = ( props : {
42+ privateUser : PrivateUser ,
3943} ) => {
40- const { privateUser, user} = props
41- if ( ! privateUser || ! user ) return null
44+ const { privateUser} = props
45+ const user = auth . currentUser
46+ if ( ! user ) return null
4247
4348 const handleDeleteAccount = async ( ) => {
4449 const confirmed = confirm (
0 commit comments