updated
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
import { generateUniqueId } from "../../../functions/generateUniqueId";
|
||||
import { getUserData } from "../../../functions/getUserData";
|
||||
import { useDroppedObjectsStore } from "../../../store/visualization/useDroppedObjectsStore";
|
||||
import { determinePosition } from "./determinePosition";
|
||||
import { getActiveProperties } from "./getActiveProperties";
|
||||
@@ -10,7 +10,8 @@ interface HandleDropProps {
|
||||
selectedZone: any;
|
||||
setFloatingWidget: (value: any) => void;
|
||||
event: React.DragEvent<HTMLDivElement>;
|
||||
projectId?:string
|
||||
projectId?: string,
|
||||
versionId?: string
|
||||
}
|
||||
|
||||
export const createHandleDrop = ({
|
||||
@@ -18,14 +19,13 @@ export const createHandleDrop = ({
|
||||
visualizationSocket,
|
||||
selectedZone,
|
||||
setFloatingWidget,
|
||||
event,projectId
|
||||
event,
|
||||
projectId,
|
||||
versionId
|
||||
}: HandleDropProps) => {
|
||||
|
||||
event.preventDefault();
|
||||
try {
|
||||
const email = localStorage.getItem("email") ?? "";
|
||||
const organization = email?.split("@")[1]?.split(".")[0];
|
||||
const userId = localStorage.getItem("userId");
|
||||
const { userId, organization, email } = getUserData();
|
||||
|
||||
const data = event.dataTransfer.getData("text/plain");
|
||||
if (widgetSubOption === "3D") return;
|
||||
@@ -98,11 +98,11 @@ export const createHandleDrop = ({
|
||||
organization,
|
||||
widget: newObject,
|
||||
zoneUuid: selectedZone.zoneUuid,
|
||||
projectId,userId
|
||||
versionId,
|
||||
projectId,
|
||||
userId
|
||||
};
|
||||
console.log('addFloatingWidget: ', addFloatingWidget);
|
||||
|
||||
console.log('visualizationSocket: ', visualizationSocket);
|
||||
if (visualizationSocket) {
|
||||
visualizationSocket.emit("v1:viz-float:add", addFloatingWidget);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user