diff --git a/src/Components/Facility/Consultations/Feed.tsx b/src/Components/Facility/Consultations/Feed.tsx index 0389fe298dc..43d5b89cb38 100644 --- a/src/Components/Facility/Consultations/Feed.tsx +++ b/src/Components/Facility/Consultations/Feed.tsx @@ -55,15 +55,15 @@ export const Feed: React.FC = ({ consultationId, facilityId }) => { const [isFullscreen, setFullscreen] = useFullscreen(); const [videoStartTime, setVideoStartTime] = useState(null); const [statusReported, setStatusReported] = useState(false); + const [facilityMiddlewareHostname, setFacilityMiddlewareHostname] = + useState(""); const authUser = useAuthUser(); - let facilityMiddlewareHostname = ""; - useQuery(routes.getPermittedFacility, { pathParams: { id: facilityId || "" }, onResponse: ({ res, data }) => { if (res && res.status === 200 && data && data.middleware_address) { - facilityMiddlewareHostname = data.middleware_address; + setFacilityMiddlewareHostname(data.middleware_address); } }, });