diff --git a/src/components/Bookmarks.tsx b/src/components/Bookmarks.tsx index 1e7e5673..cf290eff 100644 --- a/src/components/Bookmarks.tsx +++ b/src/components/Bookmarks.tsx @@ -53,7 +53,7 @@ const Bookmarks: React.FC = ({ relayPool, onLogout }) => { }) // Monitor relay status for offline sync - const relayStatuses = useRelayStatus({ relayPool, pollingInterval: 5000 }) + const relayStatuses = useRelayStatus({ relayPool }) // Automatically sync local events to remote relays when coming back online useOfflineSync({ diff --git a/src/components/RelayStatusIndicator.tsx b/src/components/RelayStatusIndicator.tsx index ff78965c..ce9148c2 100644 --- a/src/components/RelayStatusIndicator.tsx +++ b/src/components/RelayStatusIndicator.tsx @@ -10,8 +10,8 @@ interface RelayStatusIndicatorProps { } export const RelayStatusIndicator: React.FC = ({ relayPool }) => { - // Poll frequently for responsive local-only detection - const relayStatuses = useRelayStatus({ relayPool, pollingInterval: 2000 }) + // Poll for relay status updates + const relayStatuses = useRelayStatus({ relayPool }) if (!relayPool) return null diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index 867443a9..3aa3750d 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -60,8 +60,8 @@ const Settings: React.FC = ({ settings, onSave, onClose, relayPoo const saveTimeoutRef = useRef(null) const isLocallyUpdating = useRef(false) - // Poll more frequently in settings for responsive status updates - const relayStatuses = useRelayStatus({ relayPool, pollingInterval: 2000 }) + // Poll for relay status updates + const relayStatuses = useRelayStatus({ relayPool }) useEffect(() => { // Don't update from external settings if we're currently making local changes diff --git a/src/hooks/useRelayStatus.ts b/src/hooks/useRelayStatus.ts index 4ab9dadc..bc3e42cb 100644 --- a/src/hooks/useRelayStatus.ts +++ b/src/hooks/useRelayStatus.ts @@ -9,7 +9,7 @@ interface UseRelayStatusParams { export function useRelayStatus({ relayPool, - pollingInterval = 5000 + pollingInterval = 20000 }: UseRelayStatusParams) { const [relayStatuses, setRelayStatuses] = useState([])