Skip to content

Commit

Permalink
resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
AshrafMd-1 committed Nov 9, 2023
1 parent 4c9c27a commit 70fca2f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Components/Facility/Consultations/DailyRoundsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const DailyRoundsList = (props: any) => {
rounds_type: showAutomatedRounds ? "" : "NORMAL,VENTILATOR,ICU",
}}
>
{() => (
{(_) => (
<div className="flex w-full flex-col gap-4">
<div className="flex max-h-[85vh] flex-col gap-4 overflow-y-auto overflow-x-hidden px-3">
<PaginatedList.WhenEmpty className="flex w-full justify-center border-b border-gray-200 bg-white p-5 text-center text-2xl font-bold text-gray-500">
Expand Down
29 changes: 18 additions & 11 deletions src/Components/Facility/Consultations/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import useFullscreen from "../../../Common/hooks/useFullscreen.js";
import { triggerGoal } from "../../../Integrations/Plausible.js";
import useAuthUser from "../../../Common/hooks/useAuthUser.js";
import Spinner from "../../Common/Spinner.js";
import useQuery from "../../../Utils/request/useQuery";
import useQuery from "../../../Utils/request/useQuery.js";

interface IFeedProps {
facilityId: string;
Expand All @@ -46,6 +46,7 @@ export const Feed: React.FC<IFeedProps> = ({ consultationId, facilityId }) => {
middleware_address: "",
location_middleware: "",
});

const [cameraConfig, setCameraConfig] = useState<any>({});
const [bedPresets, setBedPresets] = useState<any>([]);
const [bed, setBed] = useState<any>();
Expand All @@ -56,15 +57,13 @@ export const Feed: React.FC<IFeedProps> = ({ consultationId, facilityId }) => {
const [statusReported, setStatusReported] = useState(false);
const authUser = useAuthUser();

let cameraMiddlewareHostname = "";

let facilityMiddlewareHostname = "";

useQuery(routes.getPermittedFacility, {
pathParams: { id: facilityId || "" },
onResponse: ({ res, data }) => {
if (res && res.status === 200 && data && data.middleware_address) {
cameraMiddlewareHostname = data.middleware_address;

facilityMiddlewareHostname = data.middleware_address;
}
},
});
Expand All @@ -82,7 +81,7 @@ export const Feed: React.FC<IFeedProps> = ({ consultationId, facilityId }) => {
precision: precision,
});
}
}, [precision, cameraState]);
}, [precision]);

useEffect(() => {
const timeout = setTimeout(() => {
Expand All @@ -93,7 +92,7 @@ export const Feed: React.FC<IFeedProps> = ({ consultationId, facilityId }) => {
setCamTimeout(0);
}, 5000);
return () => clearTimeout(timeout);
}, [cameraState, cameraConfig]);
}, [cameraState]);

const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);

Expand All @@ -107,8 +106,10 @@ export const Feed: React.FC<IFeedProps> = ({ consultationId, facilityId }) => {
if (consultationBedId) {
(async () => {
const { res: listAssetBedsRes, data: listAssetBedsData } =
await request(routes.getAssetBed, {
pathParams: { external_id: consultationBedId },
await request(routes.listAssetBeds, {
query: {
bed: consultationBedId,
},
});
setBed(consultationBedId);
const bedAssets: any = {
Expand All @@ -128,6 +129,12 @@ export const Feed: React.FC<IFeedProps> = ({ consultationId, facilityId }) => {
setCameraAsset({
id: bedAssets.data.results[0].asset_object.id,
accessKey: config[2] || "",
middleware_address:
bedAssets.data.results[0].asset_object?.meta
?.middleware_hostname,
location_middleware:
bedAssets.data.results[0].asset_object.location_object
?.middleware_address,
});
setCameraConfig(bedAssets.data.results[0].meta);
setCameraState({
Expand Down Expand Up @@ -208,8 +215,8 @@ export const Feed: React.FC<IFeedProps> = ({ consultationId, facilityId }) => {

const getBedPresets = async (asset: any) => {
if (asset.id && bed) {
const { data: bedAssets } = await request(routes.getAssetBed, {
pathParams: { external_id: asset.id, bed },
const { data: bedAssets } = await request(routes.listAssetBeds, {
query: { asset: asset.id, bed },
});
setBedPresets(bedAssets?.results);
}
Expand Down
1 change: 0 additions & 1 deletion src/Redux/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ const routes = {
getAssetBed: {
path: "/api/v1/assetbed/{external_id}/",
method: "GET",
TRes: Type<PaginatedResponse<AssetBedModel>>(),
},
updateAssetBed: {
path: "/api/v1/assetbed/{external_id}/",
Expand Down

0 comments on commit 70fca2f

Please sign in to comment.