code optimization

This commit is contained in:
2025-09-02 09:16:41 +05:30
parent 6f9da9e9c0
commit 0ac2bde6d3
3 changed files with 28 additions and 28 deletions

View File

@@ -1,10 +1,15 @@
import { DepthOfField, Bloom, EffectComposer, N8AO } from "@react-three/postprocessing"; import { EffectComposer, N8AO } from "@react-three/postprocessing";
import OutlineInstances from "./outlineInstances/outlineInstances"; import OutlineInstances from "./outlineInstances/outlineInstances";
import { useDeletableEventSphere, useSelectedEventSphere } from "../../../store/simulation/useSimulationStore"; import { useDeletableEventSphere, useSelectedEventSphere } from "../../../store/simulation/useSimulationStore";
import { useEffect } from "react";
export default function PostProcessing() { export default function PostProcessing() {
const { } = useSelectedEventSphere(); const { selectedEventSphere } = useSelectedEventSphere();
const { } = useDeletableEventSphere(); const { deletableEventSphere } = useDeletableEventSphere();
useEffect(() => {
}, [selectedEventSphere, deletableEventSphere])
return ( return (
<EffectComposer autoClear={false}> <EffectComposer autoClear={false}>

View File

@@ -1,7 +1,5 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { import { useSocketStore } from "../store/builder/store";
useSocketStore
} from "../store/builder/store";
import DashboardHome from "../components/Dashboard/DashboardHome"; import DashboardHome from "../components/Dashboard/DashboardHome";
import DashboardProjects from "../components/Dashboard/DashboardProjects"; import DashboardProjects from "../components/Dashboard/DashboardProjects";
import DashboardTrash from "../components/Dashboard/DashboardTrash"; import DashboardTrash from "../components/Dashboard/DashboardTrash";
@@ -19,18 +17,16 @@ const Dashboard: React.FC = () => {
const refreshToken = localStorage.getItem("refreshToken") const refreshToken = localStorage.getItem("refreshToken")
if (token) { if (token) {
useSocketStore.getState().initializeSocket(email, organization, token, refreshToken); useSocketStore.getState().initializeSocket(email, organization, token, refreshToken);
} else {
} }
}, [socket]); }, [socket, email, organization]);
return ( return (
<div className="dashboard-main"> <div className="dashboard-main">
<SidePannel setActiveTab={setActiveTab} activeTab={activeTab} /> <SidePannel setActiveTab={setActiveTab} activeTab={activeTab} />
{activeTab == "Home" && <DashboardHome />} {activeTab === "Home" && <DashboardHome />}
{activeTab == "Projects" && <DashboardProjects />} {activeTab === "Projects" && <DashboardProjects />}
{activeTab == "Trash" && <DashboardTrash />} {activeTab === "Trash" && <DashboardTrash />}
{activeTab == "Tutorials" && <DashboardTutorial />} {activeTab === "Tutorials" && <DashboardTutorial />}
</div> </div>
); );
}; };

View File

@@ -1,4 +1,3 @@
import { Object3D } from "three";
import { create } from "zustand"; import { create } from "zustand";
import { io } from "socket.io-client"; import { io } from "socket.io-client";
import * as CONSTANTS from "../../types/world/worldConstants"; import * as CONSTANTS from "../../types/world/worldConstants";