Skip to content

Commit 61490e9

Browse files
committed
fix: restore connection guard on publish section in DataPanel
The publish UI was showing even when disconnected because the client null check was dropped during migration. Replaced with isConnected store check.
1 parent 22f5c4d commit 61490e9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/components/DataPanel.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { JsonFormViewer } from '@/components/JsonFormViewer';
88
import { TopicPublishForm } from '@/components/TopicPublishForm';
99
import type { ComponentTopic, TopicEndpoint, QosProfile, SovdResourceEntityType } from '@/lib/types';
1010
import { cn } from '@/lib/utils';
11+
import { useAppStore } from '@/lib/store';
1112

1213
interface DataPanelProps {
1314
/** Data item from the API */
@@ -198,8 +199,9 @@ export function DataPanel({
198199
}: DataPanelProps) {
199200
const [publishValue, setPublishValue] = useState<unknown>(topic.type_info?.default_value || topic.data || {});
200201

202+
const isConnected = useAppStore((state) => state.isConnected);
201203
const hasData = topic.status === 'data' && topic.data !== null && topic.data !== undefined;
202-
const canPublish = !!(topic.type || topic.type_info || topic.data);
204+
const canPublish = isConnected && !!(topic.type || topic.type_info || topic.data);
203205

204206
const handleCopyFromLast = () => {
205207
if (topic.data) {

0 commit comments

Comments
 (0)