···8 const [isOpen, setIsOpen] = useState(false)
910 const open = () => setIsOpen(true)
11- const close = () => {
12- setIsOpen(false)
13- // Mark that user has actively closed the modal, don't show again this session
14- if (typeof window !== 'undefined') {
15- sessionStorage.setItem('welcomeModalClosed', 'true')
16- }
17- }
1819 useEffect(() => {
20 // Only show modal if:
21 // 1. User is not logged in
22 // 2. We're on the web (this is a web-only feature)
23 // 3. We're on the homepage (path is '/' or '/home')
24- // 4. User hasn't actively closed the modal in this session
25 if (IS_WEB && !hasSession && typeof window !== 'undefined') {
26 const currentPath = window.location.pathname
27 const isHomePage = currentPath === '/'
28- const hasUserClosedModal =
29- sessionStorage.getItem('welcomeModalClosed') === 'true'
3031- if (isHomePage && !hasUserClosedModal) {
0032 // Small delay to ensure the page has loaded
33 const timer = setTimeout(() => {
34 open()
···8 const [isOpen, setIsOpen] = useState(false)
910 const open = () => setIsOpen(true)
11+ const close = () => setIsOpen(false)
0000001213 useEffect(() => {
14 // Only show modal if:
15 // 1. User is not logged in
16 // 2. We're on the web (this is a web-only feature)
17 // 3. We're on the homepage (path is '/' or '/home')
18+ // 4. Modal hasn't been shown before
19 if (IS_WEB && !hasSession && typeof window !== 'undefined') {
20 const currentPath = window.location.pathname
21 const isHomePage = currentPath === '/'
22+ const hasModalBeenShown =
23+ localStorage.getItem('welcomeModalShown') === 'true'
2425+ if (isHomePage && !hasModalBeenShown) {
26+ // Mark that the modal has been shown, don't show again
27+ localStorage.setItem('welcomeModalShown', 'true')
28 // Small delay to ensure the page has loaded
29 const timer = setTimeout(() => {
30 open()