fix: wevbsocket url is always localhost (#1072)

This commit is contained in:
Meier Lukas
2024-09-06 21:11:58 +02:00
committed by GitHub
parent 753d091dbb
commit 8c205535eb
4 changed files with 14 additions and 9 deletions

View File

@@ -12,7 +12,7 @@ import type { AppRouter } from "@homarr/api";
import { clientApi } from "@homarr/api/client";
const wsClient = createWSClient({
url: "ws://localhost:3001",
url: typeof window === "undefined" ? "ws://localhost:3001" : `ws://${window.location.hostname}:3001`,
});
export function TRPCReactProvider(props: PropsWithChildren) {