merge fix
This commit is contained in:
@@ -44,34 +44,34 @@ const RealTimeVisulization: React.FC = () => {
|
||||
const [zonesData, setZonesData] = useState<FormattedZoneData>({});
|
||||
const { selectedZone, setSelectedZone } = useSelectedZoneStore();
|
||||
|
||||
// useEffect(() => {
|
||||
// async function GetZoneData() {
|
||||
// try {
|
||||
// const response: { data: Zone[] } | undefined = await getZonesApi(
|
||||
// "hexrfactory"
|
||||
// );
|
||||
useEffect(() => {
|
||||
async function GetZoneData() {
|
||||
try {
|
||||
const response: { data: Zone[] } | undefined = await getZonesApi(
|
||||
"hexrfactory"
|
||||
);
|
||||
|
||||
// if (!response || !response.data) {
|
||||
// return;
|
||||
// }
|
||||
// const formattedData = response?.data?.reduce<FormattedZoneData>(
|
||||
// (acc, zone) => {
|
||||
// acc[zone.zoneName] = {
|
||||
// activeSides: [],
|
||||
// panelOrder: [],
|
||||
// lockedPanels: [],
|
||||
// zoneCentrePoint: [],
|
||||
// widgets: [],
|
||||
// };
|
||||
// return acc;
|
||||
// },
|
||||
// {}
|
||||
// );
|
||||
// setZonesData(formattedData);
|
||||
// } catch (error) { }
|
||||
// }
|
||||
// GetZoneData();
|
||||
// }, []);
|
||||
if (!response || !response.data) {
|
||||
return;
|
||||
}
|
||||
const formattedData = response?.data?.reduce<FormattedZoneData>(
|
||||
(acc, zone) => {
|
||||
acc[zone.zoneName] = {
|
||||
activeSides: [],
|
||||
panelOrder: [],
|
||||
lockedPanels: [],
|
||||
zoneCentrePoint: [],
|
||||
widgets: [],
|
||||
};
|
||||
return acc;
|
||||
},
|
||||
{}
|
||||
);
|
||||
setZonesData(formattedData);
|
||||
} catch (error) { }
|
||||
}
|
||||
GetZoneData();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user