diff --git a/lib/api.js b/lib/api.js index c13f8c7c8..bd5c99629 100644 --- a/lib/api.js +++ b/lib/api.js @@ -16,11 +16,14 @@ module.exports.create = function (config) { .on('channelOpen', historyKeeper.channelOpen) .on('sessionClose', function (userId, reason) { if (['BAD_MESSAGE', 'SOCKET_ERROR', 'SEND_MESSAGE_FAIL_2'].indexOf(reason) !== -1) { + if (reason && reason.code === 'ECONNRESET') { return; } return void log.error('SESSION_CLOSE_WITH_ERROR', { userId: userId, reason: reason, }); } + + if (reason && reason === 'SOCKET_CLOSED') { return; } log.verbose('SESSION_CLOSE_ROUTINE', { userId: userId, reason: reason, diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 78510b6dd..e86fa3351 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -1175,13 +1175,9 @@ define([ } else if ($element.is('.cp-app-drive-element-noreadonly')) { hide.push('openro'); // Remove open 'view' mode } - // if it's not a plain text file - // XXX: there is a bug with this code in anon shared folder, so we disable it - if (APP.loggedIn || !APP.newSharedFolder) { - var metadata = manager.getFileData(manager.find(path)); - if (!metadata || !Util.isPlainTextFile(metadata.fileType, metadata.title)) { - hide.push('openincode'); - } + var metadata = manager.getFileData(manager.find(path)); + if (!metadata || !Util.isPlainTextFile(metadata.fileType, metadata.title)) { + hide.push('openincode'); } } else if ($element.is('.cp-app-drive-element-sharedf')) { if (containsFolder) { @@ -1204,6 +1200,7 @@ define([ hide.push('collapseall'); } containsFolder = true; + hide.push('savelocal'); hide.push('openro'); hide.push('openincode'); hide.push('properties'); @@ -1939,6 +1936,44 @@ define([ }; var getIcon = UI.getIcon; + var createShareButton = function (id, $container) { + var $shareBlock = $('