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 { useDeletableEventSphere, useSelectedEventSphere } from "../../../store/simulation/useSimulationStore";
import { useEffect } from "react";
export default function PostProcessing() {
const { } = useSelectedEventSphere();
const { } = useDeletableEventSphere();
const { selectedEventSphere } = useSelectedEventSphere();
const { deletableEventSphere } = useDeletableEventSphere();
useEffect(() => {
}, [selectedEventSphere, deletableEventSphere])
return (
<EffectComposer autoClear={false}>

View File

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

View File

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