mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-24 14:49:24 +00:00
fix(webui): guard 'Remove from Share' context menu action with canEdit
This commit is contained in:
@@ -105,13 +105,19 @@ export function FileBrowserContextMenu({
|
||||
if (!item) return null
|
||||
return (
|
||||
<ContextMenuContent>
|
||||
<ContextMenuItem
|
||||
onSelect={() => onRemoveFromShare?.(itemsToModify)}
|
||||
className="text-destructive"
|
||||
>
|
||||
<Trash2 className="mr-2 h-4 w-4" />
|
||||
<span>Remove from Share</span>
|
||||
<ContextMenuItem onSelect={handleDownload}>
|
||||
<Download className="mr-2 h-4 w-4" />
|
||||
<span>Download</span>
|
||||
</ContextMenuItem>
|
||||
{canEdit && (
|
||||
<ContextMenuItem
|
||||
onSelect={() => onRemoveFromShare?.(itemsToModify)}
|
||||
className="text-destructive"
|
||||
>
|
||||
<Trash2 className="mr-2 h-4 w-4" />
|
||||
<span>Remove from Share</span>
|
||||
</ContextMenuItem>
|
||||
)}
|
||||
</ContextMenuContent>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user