diff --git a/web/src/components/notifications/NotificationBell.tsx b/web/src/components/notifications/NotificationBell.tsx index fa1addce..1dae87de 100644 --- a/web/src/components/notifications/NotificationBell.tsx +++ b/web/src/components/notifications/NotificationBell.tsx @@ -31,9 +31,10 @@ export default function NotificationBell() { useEffect(() => { if (user) { loadNotifications(); - + subscribeToNotifications(); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [user]); const loadNotifications = async () => { diff --git a/web/src/components/notifications/NotificationCenter.tsx b/web/src/components/notifications/NotificationCenter.tsx index 56c04073..f549efa7 100644 --- a/web/src/components/notifications/NotificationCenter.tsx +++ b/web/src/components/notifications/NotificationCenter.tsx @@ -81,6 +81,7 @@ export const NotificationCenter: React.FC = () => { unsubscribe('mention', handleMention); unsubscribe('reply', handleReply); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [subscribe, unsubscribe]); const addNotification = (notification: Notification) => { diff --git a/web/src/pages/Presale.tsx b/web/src/pages/Presale.tsx index b3d1c345..18a1aa87 100644 --- a/web/src/pages/Presale.tsx +++ b/web/src/pages/Presale.tsx @@ -24,14 +24,6 @@ export default function Presale() { const [loading, setLoading] = useState(false); const [contributorsCount, setContributorsCount] = useState(0); - useEffect(() => { - if (isApiReady) { - loadPresaleData(); - const interval = setInterval(loadPresaleData, 10000); - return () => clearInterval(interval); - } - }, [api, selectedAccount, isApiReady]); - const loadPresaleData = async () => { if (!api) return; @@ -80,6 +72,15 @@ export default function Presale() { } }; + useEffect(() => { + if (isApiReady) { + loadPresaleData(); + const interval = setInterval(loadPresaleData, 10000); + return () => clearInterval(interval); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [api, selectedAccount, isApiReady]); + const handleContribute = async () => { if (!api || !selectedAccount) { toast.error('Please connect your wallet first'); @@ -335,7 +336,7 @@ export default function Presale() { - You don't have wUSDT. Please bridge USDT to wUSDT first. + You don't have wUSDT. Please bridge USDT to wUSDT first. )}