File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,10 @@ import ProgressWithFeedback from '../ui/progress/ProgressWithFeedback';
1414
1515interface UserDataModalProps {
1616 onOpenChange : ( open : boolean ) => void ;
17+ isOpen ?: boolean ; // Re-adding the isOpen prop
1718}
1819
19- const UserDataModal : React . FC < UserDataModalProps > = ( { onOpenChange } ) => {
20+ const UserDataModal : React . FC < UserDataModalProps > = ( { onOpenChange, isOpen } ) => {
2021 const { data, setData } = useEntries ( ) ;
2122 const { signOut } = useAuth ( ) ;
2223 const [ isEditingContact , setIsEditingContact ] = useState ( false ) ;
@@ -69,6 +70,11 @@ const UserDataModal: React.FC<UserDataModalProps> = ({ onOpenChange }) => {
6970 setIsEditingUsername ( false ) ;
7071 } ;
7172
73+ // Make sure we only render when isOpen is true
74+ if ( typeof isOpen === 'boolean' && ! isOpen ) {
75+ return null ;
76+ }
77+
7278 return (
7379 < DialogContent
7480 className = "max-w-3xl p-0 overflow-hidden"
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const Header: React.FC = () => {
3232 </ DialogTrigger >
3333 < UserDataModal
3434 onOpenChange = { setIsDashboardOpen }
35+ isOpen = { isDashboardOpen }
3536 />
3637 </ Dialog >
3738 ) : (
@@ -60,6 +61,7 @@ const Header: React.FC = () => {
6061 </ DialogTrigger >
6162 < UserDataModal
6263 onOpenChange = { setIsDashboardOpen }
64+ isOpen = { isDashboardOpen }
6365 />
6466 </ Dialog >
6567 ) : (
You can’t perform that action at this time.
0 commit comments