Skip to content

Commit

Permalink
fixes #7145; live refresh cns on middleware hostname change (#7149)
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad authored Feb 7, 2024
1 parent 8fb7d59 commit fd53e5e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Components/Assets/AssetType/HL7Monitor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ const HL7Monitor = (props: HL7MonitorProps) => {
};

if (isLoading) return <Loading />;

const socketUrl = `wss://${
middlewareHostname || resolvedMiddleware?.hostname
}/observations/${localipAddress}`;

return (
<div className="mx-auto flex w-full xl:mt-8">
<div className="mx-auto flex flex-col gap-4 xl:flex-row-reverse">
Expand Down Expand Up @@ -126,13 +131,12 @@ const HL7Monitor = (props: HL7MonitorProps) => {
)}

{assetType === "HL7MONITOR" && (
<HL7PatientVitalsMonitor
socketUrl={`wss://${resolvedMiddleware?.hostname}/observations/${localipAddress}`}
/>
<HL7PatientVitalsMonitor key={socketUrl} socketUrl={socketUrl} />
)}
{assetType === "VENTILATOR" && (
<VentilatorPatientVitalsMonitor
socketUrl={`wss://${resolvedMiddleware?.hostname}/observations/${localipAddress}`}
key={socketUrl}
socketUrl={socketUrl}
/>
)}
</div>
Expand Down

0 comments on commit fd53e5e

Please sign in to comment.