more system tests as login is borked
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 19s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 19s
This commit is contained in:
3
App.tsx
3
App.tsx
@@ -747,7 +747,8 @@ function App() {
|
||||
onOpenVoiceAssistant={() => setIsVoiceAssistantOpen(true)}
|
||||
onSignOut={handleSignOut}
|
||||
/>
|
||||
{session && profile && (
|
||||
{/* CRITICAL FIX: Only render the ProfileManager if a session AND a profile exist. This prevents crashes on initial load when profile is null. */}
|
||||
{isProfileManagerOpen && session && profile && (
|
||||
<ProfileManager
|
||||
isOpen={isProfileManagerOpen}
|
||||
onClose={() => setIsProfileManagerOpen(false)}
|
||||
|
||||
@@ -22,8 +22,8 @@ export const ProfileManager: React.FC<ProfileManagerProps> = ({ isOpen, onClose,
|
||||
const [activeTab, setActiveTab] = useState('profile');
|
||||
|
||||
// Profile state
|
||||
const [fullName, setFullName] = useState(profile.full_name || '');
|
||||
const [avatarUrl, setAvatarUrl] = useState(profile.avatar_url || '');
|
||||
const [fullName, setFullName] = useState(profile?.full_name || '');
|
||||
const [avatarUrl, setAvatarUrl] = useState(profile?.avatar_url || '');
|
||||
const [profileLoading, setProfileLoading] = useState(false);
|
||||
const [profileMessage, setProfileMessage] = useState('');
|
||||
|
||||
@@ -46,8 +46,8 @@ export const ProfileManager: React.FC<ProfileManagerProps> = ({ isOpen, onClose,
|
||||
// Only reset state when the modal is opened.
|
||||
// Do not reset on profile changes, which can happen during sign-out.
|
||||
if (isOpen) {
|
||||
setFullName(profile.full_name || '');
|
||||
setAvatarUrl(profile.avatar_url || '');
|
||||
setFullName(profile?.full_name || '');
|
||||
setAvatarUrl(profile?.avatar_url || '');
|
||||
setActiveTab('profile');
|
||||
setIsConfirmingDelete(false);
|
||||
setPasswordForDelete('');
|
||||
|
||||
Reference in New Issue
Block a user