Skip to content
Snippets Groups Projects
Commit a6dfb170 authored by Romain CREY's avatar Romain CREY
Browse files

fix: modal visibility

parent 3b5605df
No related branches found
No related tags found
1 merge request!15Merge Dev to Master
......@@ -16,6 +16,7 @@ const WelcomeModalContainer: React.FC<WelcomeModalContainerProps> = ({
client,
}: WelcomeModalContainerProps) => {
const [modalOpen, setModalOpen] = useState<boolean>(false)
const [modalExist, setModalExist] = useState<boolean>(false)
const { data: instanceSettings } = useInstanceSettings(client)
async function updateWelcomeModalState() {
......@@ -42,13 +43,19 @@ const WelcomeModalContainer: React.FC<WelcomeModalContainerProps> = ({
.then(async ({ data }) => {
const welcomeModalState = data[0].haveSeenWelcomeModal
if (!welcomeModalState) {
setModalOpen(true)
setModalExist(true)
}
})
}
getWelcomeModalState()
}, [])
useEffect(() => {
if (modalExist) {
setModalOpen(true)
}
}, [modalExist])
return (
<React.Fragment>
<Modal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment