code optimization
This commit is contained in:
@@ -120,7 +120,6 @@ const DashboardHome: React.FC = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
projectList &&
|
||||
projectList.map((project) => (
|
||||
<DashboardCard
|
||||
key={project._id}
|
||||
|
||||
@@ -28,7 +28,7 @@ const GlobalProperties: React.FC = () => {
|
||||
const { email, userId, organization } = getUserData();
|
||||
|
||||
const optimizeScene = async (value: any) => {
|
||||
|
||||
if (!projectId) return;
|
||||
setEnvironment(
|
||||
organization,
|
||||
userId,
|
||||
@@ -44,7 +44,7 @@ const GlobalProperties: React.FC = () => {
|
||||
};
|
||||
|
||||
const limitRenderDistance = async () => {
|
||||
|
||||
if (!projectId) return;
|
||||
if (limitDistance) {
|
||||
setEnvironment(
|
||||
organization,
|
||||
@@ -78,6 +78,7 @@ const GlobalProperties: React.FC = () => {
|
||||
}
|
||||
|
||||
const updatedDist = async (value: number) => {
|
||||
if (!projectId) return;
|
||||
setRenderDistance(value);
|
||||
// setDistance(value);
|
||||
const data = await setEnvironment(
|
||||
@@ -95,6 +96,8 @@ const GlobalProperties: React.FC = () => {
|
||||
// Function to toggle roof visibility
|
||||
const changeRoofVisibility = async () => {
|
||||
|
||||
if (!projectId) return;
|
||||
|
||||
//using REST
|
||||
const data = await setEnvironment(
|
||||
organization,
|
||||
@@ -123,6 +126,8 @@ const GlobalProperties: React.FC = () => {
|
||||
};
|
||||
|
||||
const changeWallVisibility = async () => {
|
||||
if (!projectId) return;
|
||||
|
||||
//using REST
|
||||
const data = await setEnvironment(
|
||||
organization,
|
||||
@@ -150,6 +155,8 @@ const GlobalProperties: React.FC = () => {
|
||||
};
|
||||
|
||||
const shadowVisibility = async () => {
|
||||
if (!projectId) return;
|
||||
|
||||
//using REST
|
||||
const data = await setEnvironment(
|
||||
organization,
|
||||
|
||||
Reference in New Issue
Block a user