From 08deef098dbc1e1ce30f7cc69691402e6ae287ba Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Mon, 17 Feb 2025 15:11:09 +0100 Subject: [PATCH] Remove previous hacky way of guessing `isLoggedIn` - Remove reference to `drive.uo.curvePublic` (f8442e9b981e2f76ddbb06f493bfdcfe3e262cea) - Add `common` information to `data` when sent to `make-backup.js` --- www/common/drive-ui.js | 1 + www/common/make-backup.js | 9 +++------ www/settings/inner.js | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 504b43d39..a6f8da274 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -4742,6 +4742,7 @@ define([ data.sharedFolderId = sfId; data.name = Util.fixFileName(folderName); data.folderName = Util.fixFileName(folderName) + '.zip'; + data.common = common; var uo = manager.user.userObject; if (sfId && manager.folders[sfId]) { diff --git a/www/common/make-backup.js b/www/common/make-backup.js index 29b887808..cb6b33f97 100644 --- a/www/common/make-backup.js +++ b/www/common/make-backup.js @@ -348,17 +348,14 @@ define([ max: 0, done: 0, cache: cache, - sframeChan: sframeChan + sframeChan: sframeChan, + common: data.common, }; var filesData = data.sharedFolderId && ctx.sf[data.sharedFolderId] ? ctx.sf[data.sharedFolderId].filesData : ctx.data.filesData; var links = ctx.sf[data.sharedFolderId] && ctx.sf[data.sharedFolderId].static ? ctx.data.static && ctx.sf[data.sharedFolderId].static : ctx.data.static; - if (!data.uo.curvePublic && Object.keys(ctx.data.root).length === 0) { + if (ctx.common && !ctx.common.isLoggedIn()) { // Anonymous Drive - // In anonymous drive, there are no root folder in the data - // We are going to emulate it - // One false positive: empty team drive but the result is - // functionally equivalent console.log("Anonymous drive"); // XXX: remove after testing phase ctx.data.root = {}; let index = 0; diff --git a/www/settings/inner.js b/www/settings/inner.js index 75cfc84cd..7a3863120 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -1196,6 +1196,7 @@ define([ Feedback.send('FULL_DRIVE_EXPORT_START'); var todo = function(data, filename) { var ui = Backup.createExportUI(privateData.origin); + data.common = common; var bu = Backup.create(data, common.getPad, privateData.fileHost, function(blob, errors) { saveAs(blob, filename);