From bee92f5fcdf49ab45594e004e2fd244f3582b123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Thu, 28 May 2026 21:43:44 +0200 Subject: [PATCH] =?UTF-8?q?ui/frontend:=20update=20StatusContext=20for=20P?= =?UTF-8?q?eers=20=E2=86=92=20DaemonFeed=20rename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Missed in the previous commit. The StatusContext is the only frontend consumer of the renamed service (the modules/main/.../peers/Peers.tsx React component is a different identifier — unchanged). --- client/ui/frontend/src/contexts/StatusContext.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/ui/frontend/src/contexts/StatusContext.tsx b/client/ui/frontend/src/contexts/StatusContext.tsx index de193b63d..45cd8dc15 100644 --- a/client/ui/frontend/src/contexts/StatusContext.tsx +++ b/client/ui/frontend/src/contexts/StatusContext.tsx @@ -1,19 +1,19 @@ import { createContext, useCallback, useContext, useEffect, useState, type ReactNode } from "react"; import { Events } from "@wailsio/runtime"; -import { Peers } from "@bindings/services"; +import { DaemonFeed } from "@bindings/services"; import type { Status } from "@bindings/services/models.js"; import { DaemonUnavailableOverlay } from "@/components/empty-state/DaemonUnavailableOverlay.tsx"; const EVENT_STATUS = "netbird:status"; // StatusContext is the single subscription point for the daemon status -// stream. It owns the initial Peers.Get, the netbird:status event listener, +// stream. It owns the initial DaemonFeed.Get, the netbird:status event listener, // and the synthetic DaemonUnavailable handling. The provider also renders // the DaemonUnavailableOverlay so every layout that mounts it inherits the // same blocker without re-importing the component. // // Boolean flags consumers should prefer over hand-rolled checks: -// - isReady first Peers.Get has resolved +// - isReady first DaemonFeed.Get has resolved // - isDaemonUnavailable ready and status === "DaemonUnavailable" // - isDaemonAvailable ready and status !== "DaemonUnavailable" type StatusContextValue = { @@ -41,11 +41,11 @@ export const StatusProvider = ({ children }: { children: ReactNode }) => { const refresh = useCallback(async () => { try { - const s = await Peers.Get(); + const s = await DaemonFeed.Get(); setStatus(s); setError(null); } catch (e) { - // Peers.Get returns a gRPC error when the socket itself is + // DaemonFeed.Get returns a gRPC error when the socket itself is // unreachable (daemon not running, missing socket, etc.); only // the streaming path synthesizes a DaemonUnavailable status. // Synthesize one here too so the overlay paints on cold start @@ -72,7 +72,7 @@ export const StatusProvider = ({ children }: { children: ReactNode }) => { const isDaemonUnavailable = isReady && status.status === "DaemonUnavailable"; const isDaemonAvailable = isReady && !isDaemonUnavailable; - // Don't mount children until the first Peers.Get has resolved and the + // Don't mount children until the first DaemonFeed.Get has resolved and the // daemon is reachable. Consumers (ProfileContext, SettingsContext, …) // can then assume any daemon RPC they make at mount will reach the // socket — no per-context availability gating. When the daemon flips