Remove previous hacky way of guessing isLoggedIn

- Remove reference to `drive.uo.curvePublic` (f8442e9b98)
- Add `common` information to `data` when sent to `make-backup.js`
This commit is contained in:
Fabrice Mouhartem 2025-02-17 15:11:09 +01:00
parent db620fc81f
commit 08deef098d
No known key found for this signature in database
GPG Key ID: 90579C24FD123C93
3 changed files with 5 additions and 6 deletions

View File

@ -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]) {

View File

@ -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;

View File

@ -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);