Fix share option should not be enabled for a prefix (#3135)

This commit is contained in:
Prakash Senthil Vel
2023-11-29 06:15:24 +05:30
committed by GitHub
parent 924c38faa6
commit 7b43779fb0

View File

@@ -359,6 +359,8 @@ const ListObjects = () => {
useEffect(() => {
if (selectedObjects.length === 1) {
const objectName = selectedObjects[0];
const isPrefix = objectName.endsWith("/");
let objectType: AllowedPreviews = previewObjectType(metaData, objectName);
if (objectType !== "none" && canDownload) {
@@ -367,7 +369,7 @@ const ListObjects = () => {
setCanPreviewFile(false);
}
if (objectName.endsWith("/") || canDownload) {
if (canDownload && !isPrefix) {
setCanShareFile(true);
} else {
setCanShareFile(false);