updated
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
import { setEnvironment } from "../../../../services/factoryBuilder/environment/setEnvironment";
|
||||
import * as CONSTANTS from "../../../../types/world/worldConstants";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { getUserData } from "../../../../functions/getUserData";
|
||||
const GlobalProperties: React.FC = () => {
|
||||
const { toggleView, setToggleView } = useToggleView();
|
||||
const { selectedWallItem, setSelectedWallItem } = useSelectedWallItem();
|
||||
@@ -38,14 +39,13 @@ const GlobalProperties: React.FC = () => {
|
||||
const [limitGridDistance, setLimitGridDistance] = useState(false);
|
||||
const [gridDistance, setGridDistance] = useState<number>(3);
|
||||
const { projectId } = useParams();
|
||||
const { email, userId, organization } = getUserData();
|
||||
|
||||
const optimizeScene = async (value: any) => {
|
||||
const email = localStorage.getItem("email");
|
||||
const organization = email?.split("@")[1]?.split(".")[0] || "defaultOrg";
|
||||
|
||||
setEnvironment(
|
||||
organization,
|
||||
localStorage.getItem("userId")!,
|
||||
userId,
|
||||
wallVisibility,
|
||||
roofVisibility,
|
||||
shadows,
|
||||
@@ -58,13 +58,11 @@ const GlobalProperties: React.FC = () => {
|
||||
};
|
||||
|
||||
const limitRenderDistance = async () => {
|
||||
const email = localStorage.getItem("email");
|
||||
const organization = email?.split("@")[1]?.split(".")[0] || "defaultOrg";
|
||||
|
||||
if (limitDistance) {
|
||||
setEnvironment(
|
||||
organization,
|
||||
localStorage.getItem("userId")!,
|
||||
userId,
|
||||
wallVisibility,
|
||||
roofVisibility,
|
||||
shadows,
|
||||
@@ -76,7 +74,7 @@ const GlobalProperties: React.FC = () => {
|
||||
} else {
|
||||
setEnvironment(
|
||||
organization,
|
||||
localStorage.getItem("userId")!,
|
||||
userId,
|
||||
wallVisibility,
|
||||
roofVisibility,
|
||||
shadows,
|
||||
@@ -104,13 +102,11 @@ const GlobalProperties: React.FC = () => {
|
||||
}
|
||||
|
||||
const updatedDist = async (value: number) => {
|
||||
const email = localStorage.getItem("email");
|
||||
const organization = email?.split("@")[1]?.split(".")[0] || "defaultOrg";
|
||||
setRenderDistance(value);
|
||||
// setDistance(value);
|
||||
const data = await setEnvironment(
|
||||
organization,
|
||||
localStorage.getItem("userId")!,
|
||||
userId,
|
||||
wallVisibility,
|
||||
roofVisibility,
|
||||
shadows,
|
||||
@@ -122,13 +118,11 @@ const GlobalProperties: React.FC = () => {
|
||||
|
||||
// Function to toggle roof visibility
|
||||
const changeRoofVisibility = async () => {
|
||||
const email = localStorage.getItem("email");
|
||||
const organization = email!.split("@")[1].split(".")[0];
|
||||
|
||||
//using REST
|
||||
const data = await setEnvironment(
|
||||
organization,
|
||||
localStorage.getItem("userId")!,
|
||||
userId,
|
||||
wallVisibility,
|
||||
!roofVisibility,
|
||||
shadows,
|
||||
@@ -153,12 +147,10 @@ const GlobalProperties: React.FC = () => {
|
||||
};
|
||||
// Function to toggle wall visibility
|
||||
const changeWallVisibility = async () => {
|
||||
const email = localStorage.getItem("email");
|
||||
const organization = email!.split("@")[1].split(".")[0];
|
||||
//using REST
|
||||
const data = await setEnvironment(
|
||||
organization,
|
||||
localStorage.getItem("userId")!,
|
||||
userId,
|
||||
!wallVisibility,
|
||||
roofVisibility,
|
||||
shadows,
|
||||
@@ -182,12 +174,10 @@ const GlobalProperties: React.FC = () => {
|
||||
};
|
||||
|
||||
const shadowVisibility = async () => {
|
||||
const email = localStorage.getItem("email");
|
||||
const organization = email!.split("@")[1].split(".")[0];
|
||||
//using REST
|
||||
const data = await setEnvironment(
|
||||
organization,
|
||||
localStorage.getItem("userId")!,
|
||||
userId,
|
||||
wallVisibility,
|
||||
roofVisibility,
|
||||
!shadows,
|
||||
|
||||
Reference in New Issue
Block a user