refactor: Remove unnecessary console logs and improve code structure in Dashboard components and API functions
This commit is contained in:
parent
45e50ff11c
commit
15d8c362ea
|
@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect } from "react";
|
|||
import img from "../../assets/image/image.png";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { getUserData } from "./functions/getUserData";
|
||||
import { useProjectName, useSocketStore } from "../../store/builder/store";
|
||||
import { useLoadingProgress, useProjectName, useSocketStore } from "../../store/builder/store";
|
||||
import { viewProject } from "../../services/dashboard/viewProject";
|
||||
import OuterClick from "../../utils/outerClick";
|
||||
import { KebabIcon } from "../icons/ExportCommonIcons";
|
||||
|
@ -54,6 +54,7 @@ const DashboardCard: React.FC<DashBoardCardProps> = ({
|
|||
const [renameValue, setRenameValue] = useState(projectName);
|
||||
const [isRenaming, setIsRenaming] = useState(false);
|
||||
const { projectSocket } = useSocketStore();
|
||||
const { setLoadingProgress } = useLoadingProgress();
|
||||
const kebabRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const navigateToProject = async (e: any) => {
|
||||
|
@ -64,9 +65,8 @@ const DashboardCard: React.FC<DashBoardCardProps> = ({
|
|||
} catch (error) {
|
||||
console.error("Error opening project:", error);
|
||||
}
|
||||
|
||||
setLoadingProgress(1)
|
||||
setProjectName(projectName);
|
||||
console.log('projectId: ', projectId);
|
||||
navigate(`/${projectId}`);
|
||||
};
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ const DashboardHome: React.FC = () => {
|
|||
const { userId, organization } = getUserData();
|
||||
const { projectSocket } = useSocketStore();
|
||||
const [recentDuplicateData, setRecentDuplicateData] = useState<Object>({});
|
||||
console.log("duplicateData: ", recentDuplicateData);
|
||||
|
||||
|
||||
const fetchRecentProjects = async () => {
|
||||
try {
|
||||
|
|
|
@ -111,7 +111,9 @@ async function addAssetModel(
|
|||
selectedItem,
|
||||
addEvent,
|
||||
addAsset,
|
||||
socket
|
||||
socket,
|
||||
projectId,
|
||||
userId
|
||||
);
|
||||
});
|
||||
} else {
|
||||
|
@ -129,7 +131,9 @@ async function addAssetModel(
|
|||
selectedItem,
|
||||
addEvent,
|
||||
addAsset,
|
||||
socket
|
||||
socket,
|
||||
projectId,
|
||||
userId
|
||||
);
|
||||
}
|
||||
);
|
||||
|
@ -423,7 +427,7 @@ async function handleModelLoad(
|
|||
userId: userId,
|
||||
};
|
||||
|
||||
console.log('completeData: ', completeData);
|
||||
console.log("completeData: ", completeData);
|
||||
socket.emit("v1:model-asset:add", completeData);
|
||||
|
||||
const asset: Asset = {
|
||||
|
|
|
@ -88,7 +88,6 @@ const Project: React.FC = () => {
|
|||
useEffect(() => {
|
||||
generateThumbnail();
|
||||
}, []);
|
||||
const { isRenameMode, setIsRenameMode } = useRenameModeStore();
|
||||
// console.log('isRenameMode: ', isRenameMode);
|
||||
|
||||
const { selectedUser } = useSelectedUserStore();
|
||||
|
|
|
@ -21,7 +21,6 @@ export const getFloorAssets = async (organization: string,projectId?:string) =>
|
|||
}
|
||||
|
||||
const result = await response.json();
|
||||
console.log('result: ', result);
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
|
|
|
@ -21,7 +21,6 @@ export const getZonesApi = async (organization: string, projectId?: string) => {
|
|||
}
|
||||
|
||||
const result = await response.json();
|
||||
console.log('result:zone ', result);
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
|
|
Loading…
Reference in New Issue