Fix Bug 65381 - Rooms. Public. Fixed opening files of unsupported formats.

This commit is contained in:
Nikita Gopienko 2024-01-30 14:13:30 +03:00
parent 56c71f61af
commit 496e2de0d2
5 changed files with 13 additions and 6 deletions

View File

@ -191,5 +191,6 @@
"WantToRestoreTheRooms": "All shared links in restored rooms will become active, and their contents will be available to everyone with the room links. Do you want to restore the rooms?",
"WithSubfolders": "With subfolders",
"YouLeftTheRoom": "You have left the room",
"LinkSettings": "Link settings"
"LinkSettings": "Link settings",
"FileDownloadingIsRestricted": "File downloading is restricted in this room."
}

View File

@ -178,6 +178,7 @@ export default function withFileActions(WrappedFileItem) {
onFilesClick = (e) => {
const {
t,
item,
openFileAction,
setParentId,
@ -207,7 +208,7 @@ export default function withFileActions(WrappedFileItem) {
// setRoomType(item.roomType);
}
openFileAction(item);
openFileAction(item, t);
};
onSelectTag = (tag) => {

View File

@ -218,7 +218,7 @@ const withHotkeys = (Component) => {
useHotkeys("ctrl+RIGHT, command+RIGHT", moveCaretRight, hotkeysFilter);
//Open item
useHotkeys("Enter", openItem, hotkeysFilter);
useHotkeys("Enter", () => openItem(t), hotkeysFilter);
//Back to parent folder
useHotkeys("Backspace", backToParentFolder, hotkeysFilter);

View File

@ -2091,7 +2091,7 @@ class FilesActionStore {
onMarkAsRead = (item) => this.markAsRead([], [`${item.id}`], item);
openFileAction = (item) => {
openFileAction = (item, t) => {
const { openDocEditor, isPrivacyFolder, setSelection } = this.filesStore;
const { currentDeviceType } = this.authStore.settingsStore;
const { fileItemsList } = this.pluginStore;
@ -2226,6 +2226,11 @@ class FilesActionStore {
}
}
if (!item.security.Download) {
toastr.error(t("Files:FileDownloadingIsRestricted"));
return;
}
return window.open(viewUrl, "_self");
}
};

View File

@ -494,14 +494,14 @@ class HotkeyStore {
if (this.nextFile) this.setCaret(this.nextFile);
};
openItem = () => {
openItem = (t) => {
const { selection } = this.filesStore;
const someDialogIsOpen = checkDialogsOpen();
selection.length === 1 &&
!someDialogIsOpen &&
this.filesActionsStore.openFileAction(selection[0]);
this.filesActionsStore.openFileAction(selection[0], t);
};
selectAll = () => {