Refactor socket initialization to include organization and enhance asset event handling; remove unused console logs and improve asset data structure

This commit is contained in:
2025-03-31 19:38:23 +05:30
parent e54c9e6e0d
commit e3a85c81e5
12 changed files with 137 additions and 85 deletions

View File

@@ -37,8 +37,8 @@ const Project: React.FC = () => {
setZones([]);
const email = localStorage.getItem("email");
if (email) {
useSocketStore.getState().initializeSocket(email);
const Organization = email!.split("@")[1].split(".")[0];
useSocketStore.getState().initializeSocket(email, Organization);
const name = localStorage.getItem("userName");
if (Organization && name) {
setOrganization(Organization);