- removed console.log

- fixed issue for more extensive check into tags to be more accurate
This commit is contained in:
2025-12-17 09:44:14 +00:00
parent 3fbafbbcc7
commit 71ce2a9f91
3 changed files with 19 additions and 12 deletions

View File

@@ -53,7 +53,7 @@ const RegionSelector = ({
const getMagnificationLevel = () => {
const test = socket.data;
if (!socket.data) return null;
console.log(test);
if (!test || !test.magnificationLevel) return "1x";
return test?.magnificationLevel;
};
@@ -108,12 +108,12 @@ const RegionSelector = ({
const handleSaveclick = () => {
const regions: ColourData[] = [];
const test = Array.from(paintedCells.entries());
const region1 = test.filter(([, cell]) => cell.region.name === "Bay 1");
const region2 = test.filter(([, cell]) => cell.region.name === "Bay 2");
const region3 = test.filter(([, cell]) => cell.region.name === "Bay 3");
const region4 = test.filter(([, cell]) => cell.region.name === "Bay 4");
const region5 = test.filter(([, cell]) => cell.region.name === "Bay 5");
const paintedCellsArray = Array.from(paintedCells.entries());
const region1 = paintedCellsArray.filter(([, cell]) => cell.region.name === "Bay 1");
const region2 = paintedCellsArray.filter(([, cell]) => cell.region.name === "Bay 2");
const region3 = paintedCellsArray.filter(([, cell]) => cell.region.name === "Bay 3");
const region4 = paintedCellsArray.filter(([, cell]) => cell.region.name === "Bay 4");
const region5 = paintedCellsArray.filter(([, cell]) => cell.region.name === "Bay 5");
const region1Data = {
id: 1,
cells: region1.map(([key]) => [parseInt(key.split("-")[1]), parseInt(key.split("-")[0])]),