add navigation to return to Project Manager
This commit is contained in:
parent
ca66217be8
commit
1019c675e8
@ -97,13 +97,19 @@ export default function ChatSessionView() {
|
|||||||
projectRef.current = project;
|
projectRef.current = project;
|
||||||
}, [project]);
|
}, [project]);
|
||||||
|
|
||||||
// Start heartbeat when session+project are loaded, release lock on unmount
|
// Start heartbeat when session+project are loaded
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (session && project) {
|
if (session && project) {
|
||||||
socketClient.startSessionHeartbeat();
|
socketClient.startSessionHeartbeat();
|
||||||
}
|
}
|
||||||
return () => {
|
return () => {
|
||||||
socketClient.stopSessionHeartbeat();
|
socketClient.stopSessionHeartbeat();
|
||||||
|
};
|
||||||
|
}, [session, project]);
|
||||||
|
|
||||||
|
// Release session lock on unmount only
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
const droneJson = localStorage.getItem('dtp_drone_registration');
|
const droneJson = localStorage.getItem('dtp_drone_registration');
|
||||||
if (droneJson && sessionRef.current && projectRef.current) {
|
if (droneJson && sessionRef.current && projectRef.current) {
|
||||||
try {
|
try {
|
||||||
@ -118,7 +124,7 @@ export default function ChatSessionView() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [session, project]);
|
}, []);
|
||||||
|
|
||||||
const loadSessionData = async () => {
|
const loadSessionData = async () => {
|
||||||
try {
|
try {
|
||||||
@ -954,6 +960,15 @@ export default function ChatSessionView() {
|
|||||||
<h3 className="text-sm font-semibold text-text-secondary uppercase tracking-wider">
|
<h3 className="text-sm font-semibold text-text-secondary uppercase tracking-wider">
|
||||||
Project
|
Project
|
||||||
</h3>
|
</h3>
|
||||||
|
<button
|
||||||
|
title="Project Manager"
|
||||||
|
onClick={() => navigate(`/projects/${projectId}`)}
|
||||||
|
className="text-text-muted hover:text-text-primary transition-colors"
|
||||||
|
>
|
||||||
|
<svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-4 space-y-2">
|
<div className="p-4 space-y-2">
|
||||||
{project ? (
|
{project ? (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user