Skip to content

Commit

Permalink
update kya modal behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Aug 20, 2022
1 parent 3064aa1 commit 107bf61
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/common/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,26 @@ const _Layout: FC<PropsWithChildren<{ className?: string }>> = ({

useEffect(() => {
if (!isKYAAccepted) {
markRebrandingAsShowed();
Modal.open(({ close }) => <KyaModal onClose={close} />, {
afterClose: (isConfirmed) => {
!isConfirmed && panalytics.closeKya();
markRebrandingAsShowed();
},
});
return;
}
openCookiePolicy();

let timeOutId: any;
if (!rebrandingShowed) {
setTimeout(() => {
timeOutId = setTimeout(() => {
Modal.open(({ close }) => <RebrandingModal close={close} />, {
afterClose: () => markRebrandingAsShowed(),
});
}, 10_000);
}

return () => (timeOutId ? clearTimeout(timeOutId) : undefined);
}, [isKYAAccepted, rebrandingShowed]);

useEffect(() => {
Expand Down

0 comments on commit 107bf61

Please sign in to comment.