Teams: async-store refactoring

This commit is contained in:
yflory
2019-09-06 15:45:56 +02:00
parent 2b57d82e8a
commit 834e12fcba
8 changed files with 171 additions and 110 deletions

View File

@@ -41,7 +41,7 @@ define([
var hash = window.location.hash.slice(1);
if (hash && Utils.LocalStore.isLoggedIn()) {
// Add a shared folder!
Cryptpad.addSharedFolder(secret, function (id) {
Cryptpad.addSharedFolder(teamId, secret, function (id) {
window.CryptPad_newSharedFolder = id;
cb();
});
@@ -58,13 +58,8 @@ define([
cb();
};
var addRpc = function (sframeChan, Cryptpad, Utils) {
sframeChan.on('EV_BURN_ANON_DRIVE', function () {
if (Utils.LocalStore.isLoggedIn()) { return; }
Utils.LocalStore.setFSHash('');
Utils.LocalStore.clearThumbnail();
window.location.reload();
});
sframeChan.on('Q_DRIVE_USEROBJECT', function (data, cb) {
data.teamId = teamId;
Cryptpad.userObjectCommand(data, cb);
});
// XXX no drive restore in teams? you could restore old keys...
@@ -115,9 +110,9 @@ define([
afterSecrets: afterSecrets,
noHash: true,
noRealtime: true,
driveEvents: true,
//driveEvents: true,
addRpc: addRpc,
isDrive: true,
isDrive: true, // Used for history...
});
});
});