fix a couple of errors stalling file uploades

This commit is contained in:
Ralf Becker 2020-10-19 11:45:34 +02:00
parent 72769e7a43
commit fa98eb1071
4 changed files with 8 additions and 6 deletions

View File

@ -1866,10 +1866,11 @@ var et2_nextmatch = /** @class */ (function (_super) {
* @param {object} target * @param {object} target
*/ */
et2_nextmatch.prototype.handle_drop = function (event, target) { et2_nextmatch.prototype.handle_drop = function (event, target) {
var _a;
// Check to see if we can handle the link // Check to see if we can handle the link
// First, find the UID // First, find the UID
var row = this.controller.getRowByNode(target); var row = this.controller.getRowByNode(target);
var uid = row.uid || null; var uid = ((_a = row) === null || _a === void 0 ? void 0 : _a.uid) || null;
// Get the file information // Get the file information
var files = []; var files = [];
if (event.originalEvent && event.originalEvent.dataTransfer && if (event.originalEvent && event.originalEvent.dataTransfer &&

View File

@ -2518,7 +2518,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
// Check to see if we can handle the link // Check to see if we can handle the link
// First, find the UID // First, find the UID
const row = this.controller.getRowByNode(target); const row = this.controller.getRowByNode(target);
const uid = row.uid || null; const uid = row?.uid || null;
// Get the file information // Get the file information
let files = []; let files = [];

View File

@ -1068,12 +1068,13 @@ var filemanagerAPP = /** @class */ (function (_super) {
* Needs to be a directory * Needs to be a directory
*/ */
filemanagerAPP.prototype.hidden_upload_enabled = function (_action, _senders) { filemanagerAPP.prototype.hidden_upload_enabled = function (_action, _senders) {
var _a;
if (_senders[0].id == 'nm') if (_senders[0].id == 'nm')
return false; return false;
var data = egw.dataGetUIDdata(_senders[0].id); var data = egw.dataGetUIDdata(_senders[0].id);
var readonly = (data.data.class || '').split(/ +/).indexOf('noEdit') >= 0; var readonly = (((_a = data) === null || _a === void 0 ? void 0 : _a.data.class) || '').split(/ +/).indexOf('noEdit') >= 0;
// symlinks dont have mime 'http/unix-directory', but server marks all directories with class 'isDir' // symlinks dont have mime 'http/unix-directory', but server marks all directories with class 'isDir'
return (data.data.is_dir && !readonly); return (!_senders[0].id || data.data.is_dir && !readonly);
}; };
/** /**
* View the link from an existing share * View the link from an existing share

View File

@ -1290,10 +1290,10 @@ export class filemanagerAPP extends EgwApp
{ {
if (_senders[0].id == 'nm') return false; if (_senders[0].id == 'nm') return false;
let data = egw.dataGetUIDdata(_senders[0].id); let data = egw.dataGetUIDdata(_senders[0].id);
let readonly = (data.data.class || '').split(/ +/).indexOf('noEdit') >= 0; let readonly = (data?.data.class || '').split(/ +/).indexOf('noEdit') >= 0;
// symlinks dont have mime 'http/unix-directory', but server marks all directories with class 'isDir' // symlinks dont have mime 'http/unix-directory', but server marks all directories with class 'isDir'
return (data.data.is_dir && !readonly); return (!_senders[0].id || data.data.is_dir && !readonly);
} }
/** /**