From 446a429d6b6d306d10b652e53a85622cda291096 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 27 May 2020 13:21:59 +0200 Subject: [PATCH] Fix share modal in anon drive --- www/common/drive-ui.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 0b5a5c009..db641c3e2 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -4215,8 +4215,9 @@ define([ el = manager.find(paths[0].path); var parsed, modal; var friends = common.getFriends(); + var anonDrive = manager.isPathIn(currentPath, [FILES_DATA]) && !APP.loggedIn; - if (manager.isFolder(el) && !manager.isSharedFolder(el)) { // Folder + if (manager.isFolder(el) && !manager.isSharedFolder(el) && !anonDrive) { // Folder // if folder is inside SF if (manager.isInSharedFolder(paths[0].path)) { return void UI.alert(Messages.convertFolderToSF_SFParent); @@ -4254,8 +4255,12 @@ define([ }); } } else { // File or shared folder - var sf = manager.isSharedFolder(el); - data = sf ? manager.getSharedFolderData(el) : manager.getFileData(el); + var sf = !anonDrive && manager.isSharedFolder(el); + if (anonDrive) { + data = el; + } else { + data = sf ? manager.getSharedFolderData(el) : manager.getFileData(el); + } parsed = (data.href && data.href.indexOf('#') !== -1) ? Hash.parsePadUrl(data.href) : {}; var roParsed = Hash.parsePadUrl(data.roHref); var padType = parsed.type || roParsed.type;