Skip to content

Commit

Permalink
Fixed: drawer did not open on non publisher node.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Jan 9, 2025
1 parent fcc60a3 commit 1177b7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/nodes/NodeVDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const NodeVDrawer: React.FC<NodeVDrawerProps> = ({
)
}

if (!version || !version.id || !publisherId) {
if (!version || !version.id) {
return null
}

Expand Down Expand Up @@ -202,7 +202,7 @@ const NodeVDrawer: React.FC<NodeVDrawerProps> = ({
onCloseDeleteModal={() => setIsDeleteModalOpen(false)}
nodeId={nodeId}
versionId={version.id}
publisherId={publisherId}
publisherId={publisherId as string}
/>
</>
)
Expand Down
6 changes: 5 additions & 1 deletion components/nodes/NodeVersionDeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type NodeVersionDeleteModalProps = {
onCloseDeleteModal: () => void
nodeId: string
versionId: string
publisherId: string
publisherId?: string
}

export const NodeVersionDeleteModal: React.FC<NodeVersionDeleteModalProps> = ({
Expand All @@ -23,6 +23,10 @@ export const NodeVersionDeleteModal: React.FC<NodeVersionDeleteModalProps> = ({
const deleteVersionMutation = useDeleteNodeVersion({})

const handleDeleteVersion = () => {
if (!publisherId) {
toast.error('Cannot delete version.')
return
}
deleteVersionMutation.mutate(
{
nodeId: nodeId,
Expand Down

0 comments on commit 1177b7a

Please sign in to comment.