From a169f02e8e2bccfea9f70167aacb01f8d3242afa Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Wed, 7 Aug 2024 12:55:35 +0530 Subject: [PATCH] Camera Feed: Ensure camera moves everytime the preset is clicked (#8254) --- .../Facility/ConsultationDetails/ConsultationFeedTab.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx index 34931b303f8..7b266e91639 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx @@ -167,7 +167,14 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => { result: "success", }); setHasMoved(false); - setPreset(value); + // Voluntarily copying to trigger change of reference of the position attribute, so that the useEffect of CameraFeed that handles the moves gets triggered. + setPreset({ + ...value, + meta: { + ...value.meta, + position: { ...value.meta.position }, + }, + }); }} /> {isUpdatingPreset ? (