Refactor code by removing unnecessary lines and comments, and update wall thickness in builder store
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useThree } from "@react-three/fiber";
|
||||
import { MathUtils, Vector3 } from "three";
|
||||
import { Vector3 } from "three";
|
||||
import CommentInstances from "./instances/commentInstances";
|
||||
import { Sphere } from "@react-three/drei";
|
||||
import { useActiveTool, useSelectedComment } from "../../../store/builder/store";
|
||||
|
||||
|
||||
function CommentsGroup() {
|
||||
const { gl, raycaster, camera, scene, pointer, size } = useThree();
|
||||
const { activeTool } = useActiveTool();
|
||||
const [hoverPos, setHoverPos] = useState<Vector3 | null>(null);
|
||||
const { setSelectedComment, setCommentPositionState, setPosition2Dstate } = useSelectedComment();
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const canvasElement = gl.domElement;
|
||||
|
||||
|
||||
@@ -6,17 +6,16 @@ import { useParams } from 'react-router-dom';
|
||||
import { getUserData } from '../../../../functions/getUserData';
|
||||
import { getRelativeTime } from '../../../../components/ui/collaboration/function/getRelativeTime';
|
||||
|
||||
|
||||
function CommentInstances() {
|
||||
const { comments, setComments } = useCommentStore();
|
||||
const { projectId } = useParams();
|
||||
const { userId } = getUserData()
|
||||
|
||||
const getThreads = async () => {
|
||||
if (!projectId) return;
|
||||
try {
|
||||
const getComments = await getAllThreads(projectId);
|
||||
|
||||
|
||||
const formattedThreads = Array.isArray(getComments.data)
|
||||
? getComments.data.map((thread: any) => ({
|
||||
...thread,
|
||||
@@ -32,7 +31,6 @@ function CommentInstances() {
|
||||
: [],
|
||||
}))
|
||||
: [];
|
||||
// console.log('formattedThreads: ', formattedThreads);
|
||||
setComments(formattedThreads);
|
||||
} catch (err) {
|
||||
// console.error("Failed to fetch threads:", err);
|
||||
|
||||
Reference in New Issue
Block a user