socket and api integerated successfully
This commit is contained in:
@@ -65,7 +65,7 @@ function DecalCreator() {
|
||||
const updatedWall = getWallById(wallIntersect.object.userData.wallUuid);
|
||||
if (updatedWall) {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallApi(projectId, selectedVersion?.versionId || '', updatedWall);
|
||||
@@ -111,7 +111,7 @@ function DecalCreator() {
|
||||
setTimeout(() => {
|
||||
const updatedFloor = getFloorById(floorIntersect.object.userData.floorUuid);
|
||||
if (projectId && updatedFloor) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertFloorApi(projectId, selectedVersion?.versionId || '', updatedFloor);
|
||||
|
||||
@@ -148,7 +148,7 @@ export function useDecalEventHandlers({
|
||||
const updatedWall = getWallById(parent.wallUuid);
|
||||
if (updatedWall) {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallApi(projectId, selectedVersion?.versionId || '', updatedWall);
|
||||
@@ -174,7 +174,7 @@ export function useDecalEventHandlers({
|
||||
const updatedFloor = parent;
|
||||
|
||||
if (projectId && updatedFloor) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertFloorApi(projectId, selectedVersion?.versionId || '', updatedFloor);
|
||||
@@ -203,7 +203,7 @@ export function useDecalEventHandlers({
|
||||
const updatedWall = removeDecalInWall(decalUuid);
|
||||
|
||||
if (projectId && updatedWall) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallApi(projectId, selectedVersion?.versionId || '', updatedWall);
|
||||
@@ -226,7 +226,7 @@ export function useDecalEventHandlers({
|
||||
const updatedFloor = removeDecalInFloor(decalUuid);
|
||||
|
||||
if (projectId && updatedFloor) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertFloorApi(projectId, selectedVersion?.versionId || '', updatedFloor);
|
||||
|
||||
@@ -135,7 +135,7 @@ function AisleCreator() {
|
||||
|
||||
const addAilseToBackend = (aisle: Aisle) => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
|
||||
@@ -440,7 +440,7 @@ async function handleModelLoad(
|
||||
userId: userId,
|
||||
};
|
||||
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
setAssetsApi({
|
||||
@@ -492,7 +492,7 @@ async function handleModelLoad(
|
||||
userId: userId,
|
||||
};
|
||||
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
setAssetsApi({
|
||||
|
||||
@@ -145,7 +145,7 @@ export function useModelEventHandlers({
|
||||
if (leftDrag.current || toggleView) return;
|
||||
if (activeTool === 'delete' && deletableFloorAsset && deletableFloorAsset.uuid === asset.modelUuid) {
|
||||
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// REST
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ const DxfFile = () => {
|
||||
if (dfxWallGenerate) {
|
||||
dfxWallGenerate.map((wall: Wall) => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallApi(projectId, selectedVersion?.versionId || '', wall);
|
||||
|
||||
@@ -120,7 +120,7 @@ function FloorCreator() {
|
||||
})
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -176,7 +176,7 @@ function FloorCreator() {
|
||||
})
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -242,7 +242,7 @@ function FloorCreator() {
|
||||
})
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
if (projectId && asset) {
|
||||
|
||||
removeWallAsset(asset.modelUuid);
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -142,7 +142,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
}
|
||||
}
|
||||
})
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -185,7 +185,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
if (removedFloors.length > 0) {
|
||||
removedFloors.forEach(floor => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -226,7 +226,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
if (updatedFloors.length > 0) {
|
||||
updatedFloors.forEach(floor => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -274,7 +274,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
if (removedZones.length > 0) {
|
||||
removedZones.forEach(zone => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -315,7 +315,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
if (updatedZones.length > 0) {
|
||||
updatedZones.forEach(zone => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -452,7 +452,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
});
|
||||
|
||||
if (projectId && updatedWallAsset) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallAssetApi(projectId, selectedVersion?.versionId || '', updatedWallAsset);
|
||||
@@ -474,7 +474,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
});
|
||||
}
|
||||
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -519,7 +519,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
|
||||
if (updatedFloors.length > 0 && projectId) {
|
||||
updatedFloors.forEach(updatedFloor => {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -564,7 +564,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
|
||||
if (updatedZones.length > 0 && projectId) {
|
||||
updatedZones.forEach(updatedZone => {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
const updatedAisles = getAislesByPointId(point.pointUuid);
|
||||
if (updatedAisles.length > 0 && projectId) {
|
||||
updatedAisles.forEach((updatedAisle) => {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -247,7 +247,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
});
|
||||
|
||||
if (projectId && updatedWallAsset) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallAssetApi(projectId, selectedVersion?.versionId || '', updatedWallAsset);
|
||||
@@ -269,7 +269,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
});
|
||||
}
|
||||
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -311,7 +311,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
const updatedFloors = getFloorsByPointId(point.pointUuid);
|
||||
if (updatedFloors && updatedFloors.length > 0 && projectId) {
|
||||
updatedFloors.forEach((updatedFloor) => {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -353,7 +353,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
const updatedZones = getZonesByPointId(point.pointUuid);
|
||||
if (updatedZones && updatedZones.length > 0 && projectId) {
|
||||
updatedZones.forEach((updatedZone) => {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -404,7 +404,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
if (removedAisles.length > 0) {
|
||||
removedAisles.forEach(aisle => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -455,7 +455,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
if (projectId && asset) {
|
||||
|
||||
removeWallAsset(asset.modelUuid);
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -480,7 +480,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
})
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -526,7 +526,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
if (removedFloors.length > 0) {
|
||||
removedFloors.forEach(floor => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -567,7 +567,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
if (updatedFloors.length > 0) {
|
||||
updatedFloors.forEach(floor => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -614,7 +614,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
if (removedZones.length > 0) {
|
||||
removedZones.forEach(zone => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -655,7 +655,7 @@ function Point({ point }: { readonly point: Point }) {
|
||||
if (updatedZones.length > 0) {
|
||||
updatedZones.forEach(zone => {
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ function WallCreator() {
|
||||
removeWall(wall.wallUuid);
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -151,7 +151,7 @@ function WallCreator() {
|
||||
addWall(wall2);
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallApi(projectId, selectedVersion?.versionId || '', wall2);
|
||||
@@ -211,7 +211,7 @@ function WallCreator() {
|
||||
})
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallApi(projectId, selectedVersion?.versionId || '', wall3);
|
||||
@@ -247,7 +247,7 @@ function WallCreator() {
|
||||
addWall(wall1);
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallApi(projectId, selectedVersion?.versionId || '', wall1);
|
||||
@@ -280,7 +280,7 @@ function WallCreator() {
|
||||
addWall(wall2);
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallApi(projectId, selectedVersion?.versionId || '', wall2);
|
||||
@@ -344,7 +344,7 @@ function WallCreator() {
|
||||
})
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallApi(projectId, selectedVersion?.versionId || '', wall3);
|
||||
@@ -430,7 +430,7 @@ function WallCreator() {
|
||||
})
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
// API
|
||||
|
||||
upsertWallApi(projectId, selectedVersion?.versionId || '', wall);
|
||||
|
||||
@@ -126,7 +126,7 @@ function WallAssetInstance({ wallAsset }: { wallAsset: WallAsset }) {
|
||||
const updatedWallAsset = getWallAssetById(wallAsset.modelUuid);
|
||||
|
||||
if (projectId && updatedWallAsset) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -196,7 +196,7 @@ function WallAssetInstance({ wallAsset }: { wallAsset: WallAsset }) {
|
||||
const removedWallAsset = removeWallAsset(wallAsset.modelUuid);
|
||||
|
||||
if (projectId && removedWallAsset) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -292,7 +292,7 @@ function WallAssetInstance({ wallAsset }: { wallAsset: WallAsset }) {
|
||||
setSelectedWallAsset(null);
|
||||
}
|
||||
}}
|
||||
onPointerOver={(e) => {
|
||||
onPointerEnter={(e) => {
|
||||
if (!toggleView) {
|
||||
e.stopPropagation();
|
||||
let currentObject = e.object as THREE.Object3D;
|
||||
|
||||
@@ -62,7 +62,7 @@ function WallAssetCreator() {
|
||||
|
||||
addWallAsset(newWallAsset);
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ function ZoneCreator() {
|
||||
})
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -172,7 +172,7 @@ function ZoneCreator() {
|
||||
})
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
@@ -236,7 +236,7 @@ function ZoneCreator() {
|
||||
})
|
||||
|
||||
if (projectId) {
|
||||
if (!socket?.active) {
|
||||
if (!socket?.connected) {
|
||||
|
||||
// API
|
||||
|
||||
|
||||
Reference in New Issue
Block a user