Fix Bug 53332 - Client.Files. ‘Warning. Bad request’ on .fb2 sharing on personal

This commit is contained in:
Alexey Safronov 2021-10-26 14:50:25 +03:00
parent e04190acc5
commit 9d0de00fac
2 changed files with 9 additions and 13 deletions

View File

@ -601,7 +601,7 @@ class FilesActionStore {
} = this.treeFoldersStore;
const {
isAccessedSelected,
isWebEditSelected,
canConvertSelected,
isThirdPartyRootSelection,
hasSelection,
} = this.filesStore;
@ -615,7 +615,7 @@ class FilesActionStore {
case "download":
return hasSelection;
case "downloadAs":
return isWebEditSelected && hasSelection;
return canConvertSelected;
case "moveTo":
return (
!isThirdPartyRootSelection &&

View File

@ -426,6 +426,8 @@ class FilesStore {
const { isDesktopClient } = this.authStore.settingsStore;
if (isFile) {
const shouldEdit = canWebEdit(item.fileExst);
const shouldView = canViewedDocs(item.fileExst);
let fileOptions = [
//"open",
"edit",
@ -470,12 +472,12 @@ class FilesStore {
"unsubscribe",
]);
if (!this.isWebEditSelected && !canViewedDocs(item.fileExst)) {
if (!shouldEdit && !shouldView) {
fileOptions = this.removeOptions(fileOptions, ["sharing-settings"]);
}
}
if (!this.isWebEditSelected) {
if (!this.canConvertSelected) {
fileOptions = this.removeOptions(fileOptions, ["download-as"]);
}
@ -698,11 +700,7 @@ class FilesStore {
);
}
if (
!canWebEdit(item.fileExst) &&
!canViewedDocs(item.fileExst) &&
!fileOptions.includes("view")
) {
if (!shouldEdit && !shouldView && !fileOptions.includes("view")) {
fileOptions = this.removeOptions(fileOptions, [
"edit",
"preview",
@ -710,7 +708,7 @@ class FilesStore {
]);
}
if (!canWebEdit(item.fileExst) && canViewedDocs(item.fileExst)) {
if (!shouldEdit && shouldView) {
fileOptions = this.removeOptions(fileOptions, ["edit"]);
}
@ -1133,7 +1131,6 @@ class FilesStore {
const contextOptions = this.getFilesContextOptions(item, canOpenPlayer);
const isThirdPartyFolder = providerKey && id === rootFolderId;
//const isCanWebEdit = canWebEdit(item.fileExst);
const iconSize = this.viewAs === "tile" && isMobile ? 32 : 24;
const icon = getIcon(iconSize, fileExst, providerKey, contentLength);
@ -1203,7 +1200,6 @@ class FilesStore {
webUrl,
providerKey,
canOpenPlayer,
//canWebEdit: isCanWebEdit,
//canShare,
canShare,
canEdit,
@ -1367,7 +1363,7 @@ class FilesStore {
return !!withProvider;
}
get isWebEditSelected() {
get canConvertSelected() {
const { filesConverts } = this.formatsStore.docserviceStore;
const selection = this.selection.length