Web: Files: fixed context options

This commit is contained in:
Nikita Gopienko 2021-09-07 16:11:42 +03:00
parent fd47c528c7
commit efaa0e75ce
2 changed files with 14 additions and 9 deletions

View File

@ -57,9 +57,6 @@ export default function withFileActions(WrappedFileItem) {
const notSelectable = e.target.classList.contains("not-selectable");
const isFileName = e.target.classList.contains("item-file-name");
console.log("e.target.classList", e.target.classList);
console.log("isFileName", isFileName);
if (isPrivacy || (!draggable && !isFileName)) return;
if (window.innerWidth < 1025 || notSelectable) {

View File

@ -127,16 +127,16 @@ class FilesStore {
initFiles = () => {
if (this.isInit) return;
const { isAuthenticated } = this.authStore;
const { isAuthenticated, settingsStore } = this.authStore;
const { getFilesSettings } = this.filesSettingsStore;
const {
getPortalCultures,
isDesktopClient,
getIsEncryptionSupport,
getEncryptionKeys,
setModuleInfo,
} = this.settingsStore;
const { isDesktopClient } = settingsStore;
setModuleInfo(config.homepage, config.id);
@ -424,7 +424,8 @@ class FilesStore {
const isShareItem = isShare(item.rootFolderType);
const isCommonFolder = isCommon(item.rootFolderType);
const { isDesktopClient, personal } = this.settingsStore;
const { personal } = this.settingsStore;
const { isDesktopClient } = this.authStore.settingsStore;
if (isFile) {
let fileOptions = [
@ -681,7 +682,7 @@ class FilesStore {
"download-as",
]);
if (!this.authStore.settingsStore.isDesktopClient) {
if (!isDesktopClient) {
fileOptions = this.removeOptions(fileOptions, ["sharing-settings"]);
}
@ -748,7 +749,7 @@ class FilesStore {
"copy-to",
]);
if (!this.authStore.settingsStore.isDesktopClient) {
if (!isDesktopClient) {
folderOptions = this.removeOptions(folderOptions, ["rename"]);
}
}
@ -820,6 +821,13 @@ class FilesStore {
if (isThirdPartyFolder) {
folderOptions = this.removeOptions(folderOptions, ["move-to"]);
if (isDesktopClient) {
folderOptions = this.removeOptions(folderOptions, [
"separator2",
"delete",
]);
}
} else {
folderOptions = this.removeOptions(folderOptions, [
"change-thirdparty-info",
@ -1028,7 +1036,7 @@ class FilesStore {
);
case FolderType.Privacy:
return (
this.settingsStore.isDesktopClient &&
this.authStore.settingsStore.isDesktopClient &&
this.settingsStore.isEncryptionSupport
);
case FolderType.COMMON: