mirror of https://github.com/xwiki-labs/cryptpad
Merge branch 'staging' into better-testing
This commit is contained in:
commit
bb548b3428
|
@ -837,6 +837,7 @@ define([
|
|||
var proxy = store.proxy;
|
||||
var userObject = store.userObject = UserObject.init(proxy.drive, {
|
||||
pinPads: Store.pinPads,
|
||||
unpinPads: Store.unpinPads,
|
||||
loggedIn: store.loggedIn,
|
||||
log: function (msg) {
|
||||
postMessage("DRIVE_LOG", msg);
|
||||
|
|
|
@ -13,6 +13,9 @@ define([
|
|||
};
|
||||
|
||||
module.init = function (config, exp, files) {
|
||||
var unpinPads = config.unpinPads || function () {
|
||||
console.error("unpinPads was not provided");
|
||||
};
|
||||
var pinPads = config.pinPads;
|
||||
var loggedIn = config.loggedIn;
|
||||
var workgroup = config.workgroup;
|
||||
|
@ -83,11 +86,21 @@ define([
|
|||
if (workgroup || (!loggedIn && !config.testMode)) { return; }
|
||||
|
||||
var filesList = exp.getFiles([ROOT, 'hrefArray', TRASH]);
|
||||
var toClean = [];
|
||||
exp.getFiles([FILES_DATA]).forEach(function (id) {
|
||||
if (filesList.indexOf(id) === -1) {
|
||||
var fd = exp.getFileData(id);
|
||||
if (fd && fd.href) {
|
||||
toClean.push(Hash.hrefToHexChannelId(fd.href));
|
||||
}
|
||||
spliceFileData(id);
|
||||
}
|
||||
});
|
||||
if (!toClean.length) { return; }
|
||||
unpinPads(toClean, function (response) {
|
||||
if (response && response.error) { return console.error(response.error); }
|
||||
// console.error(response);
|
||||
});
|
||||
};
|
||||
var deleteHrefs = function (ids) {
|
||||
ids.forEach(function (obj) {
|
||||
|
|
|
@ -2233,6 +2233,9 @@ define([
|
|||
appStatus.ready(true);
|
||||
};
|
||||
var displayDirectory = APP.displayDirectory = function (path, force) {
|
||||
if (history.isHistoryMode) {
|
||||
return void _displayDirectory(path, force);
|
||||
}
|
||||
updateObject(sframeChan, proxy, function () {
|
||||
copyObjectValue(files, proxy.drive);
|
||||
_displayDirectory(path, force);
|
||||
|
@ -2902,14 +2905,12 @@ define([
|
|||
});
|
||||
|
||||
history.onEnterHistory = function (obj) {
|
||||
var files = obj.drive;
|
||||
filesOp = FO.init(files, config);
|
||||
copyObjectValue(files, obj.drive);
|
||||
appStatus.isReady = true;
|
||||
refresh();
|
||||
};
|
||||
history.onLeaveHistory = function () {
|
||||
var files = proxy.drive;
|
||||
filesOp = FO.init(files, config);
|
||||
copyObjectValue(files, proxy.drive);
|
||||
refresh();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue