simplify: remove project subscribe, humans get all events
All checks were successful
Deploy Web Client / deploy (push) Successful in 37s
All checks were successful
Deploy Web Client / deploy (push) Successful in 37s
This commit is contained in:
parent
02b426a013
commit
5a1878ae02
@ -3,7 +3,6 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
import { getProjects, Project } from "@/lib/api";
|
import { getProjects, Project } from "@/lib/api";
|
||||||
import { wsClient } from "@/lib/ws";
|
|
||||||
import Sidebar from "@/components/Sidebar";
|
import Sidebar from "@/components/Sidebar";
|
||||||
import KanbanBoard from "@/components/KanbanBoard";
|
import KanbanBoard from "@/components/KanbanBoard";
|
||||||
import ChatPanel from "@/components/ChatPanel";
|
import ChatPanel from "@/components/ChatPanel";
|
||||||
@ -32,14 +31,6 @@ export default function ProjectPage() {
|
|||||||
|
|
||||||
const project = projects.find((p) => p.slug === slug);
|
const project = projects.find((p) => p.slug === slug);
|
||||||
|
|
||||||
// Subscribe to project WS events
|
|
||||||
useEffect(() => {
|
|
||||||
if (project?.id) {
|
|
||||||
wsClient.subscribeProject(project.id);
|
|
||||||
return () => wsClient.unsubscribeProject(project.id);
|
|
||||||
}
|
|
||||||
}, [project?.id]);
|
|
||||||
|
|
||||||
const handleProjectUpdated = (updated: Project) => {
|
const handleProjectUpdated = (updated: Project) => {
|
||||||
setProjects((prev) => prev.map((p) => (p.id === updated.id ? updated : p)));
|
setProjects((prev) => prev.map((p) => (p.id === updated.id ? updated : p)));
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user