Skip to content

Commit

Permalink
Merge branch 'master' into soon
Browse files Browse the repository at this point in the history
  • Loading branch information
ansuz committed Jan 18, 2019
2 parents 6cf8720 + 1ecc460 commit 69b50dd
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions www/settings/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,32 @@ define([
});
});
sframeChan.on('Q_SETTINGS_DRIVE_GET', function (d, cb) {
if (d === "full") {
// We want shared folders too
}
Cryptpad.getUserObject(function (obj) {
if (obj.error) { return void cb(obj); }
var result = {
uo: obj,
sf: {}
};
if (!obj.drive || !obj.drive.sharedFolders) { return void cb(result); }
Utils.nThen(function (waitFor) {
Object.keys(obj.drive.sharedFolders).forEach(function (id) {
Cryptpad.getSharedFolder(id, waitFor(function (obj) {
result.sf[id] = obj;
}));
if (d === "full") {
// We want shared folders too
var result = {
uo: obj,
sf: {}
};
if (!obj.drive || !obj.drive.sharedFolders) { return void cb(result); }
Utils.nThen(function (waitFor) {
Object.keys(obj.drive.sharedFolders).forEach(function (id) {
Cryptpad.getSharedFolder(id, waitFor(function (obj) {
result.sf[id] = obj;
}));
});
}).nThen(function () {
cb(result);
});
}).nThen(function () {
cb(result);
});
return;
}
// We want only the user object
cb(obj);
});
});
sframeChan.on('Q_SETTINGS_DRIVE_SET', function (data, cb) {
if (data && data.uo) { data = data.uo; }
var sjson = JSON.stringify(data);
require([
'/common/cryptget.js',
Expand Down

0 comments on commit 69b50dd

Please sign in to comment.