fix: move hooks before early return in BoardView, remove unused attachmentMode prop
Fixed React hooks rules violation where useState and useCallback were called after a conditional return in BoardView. Removed unused attachmentMode prop from AttachmentSection (can be re-added when file dialog is wired up).
This commit is contained in:
@@ -6,7 +6,6 @@ import type { Attachment } from "@/types/board";
|
||||
interface AttachmentSectionProps {
|
||||
cardId: string;
|
||||
attachments: Attachment[];
|
||||
attachmentMode: "link" | "copy";
|
||||
}
|
||||
|
||||
export function AttachmentSection({
|
||||
|
||||
@@ -24,9 +24,6 @@ export function CardDetailModal({ cardId, onClose }: CardDetailModalProps) {
|
||||
cardId ? s.board?.cards[cardId] ?? null : null
|
||||
);
|
||||
const boardLabels = useBoardStore((s) => s.board?.labels ?? []);
|
||||
const attachmentMode = useBoardStore(
|
||||
(s) => s.board?.settings.attachmentMode ?? "link"
|
||||
);
|
||||
const updateCard = useBoardStore((s) => s.updateCard);
|
||||
|
||||
const open = cardId != null && card != null;
|
||||
@@ -82,7 +79,6 @@ export function CardDetailModal({ cardId, onClose }: CardDetailModalProps) {
|
||||
<AttachmentSection
|
||||
cardId={cardId}
|
||||
attachments={card.attachments}
|
||||
attachmentMode={attachmentMode}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user