|
|
@ -13,6 +13,9 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
module.init = function (config, exp, files) {
|
|
|
|
module.init = function (config, exp, files) {
|
|
|
|
|
|
|
|
var unpinPads = config.unpinPads || function () {
|
|
|
|
|
|
|
|
console.error("unpinPads was not provided");
|
|
|
|
|
|
|
|
};
|
|
|
|
var pinPads = config.pinPads;
|
|
|
|
var pinPads = config.pinPads;
|
|
|
|
var loggedIn = config.loggedIn;
|
|
|
|
var loggedIn = config.loggedIn;
|
|
|
|
var workgroup = config.workgroup;
|
|
|
|
var workgroup = config.workgroup;
|
|
|
@ -83,11 +86,21 @@ define([
|
|
|
|
if (workgroup || (!loggedIn && !config.testMode)) { return; }
|
|
|
|
if (workgroup || (!loggedIn && !config.testMode)) { return; }
|
|
|
|
|
|
|
|
|
|
|
|
var filesList = exp.getFiles([ROOT, 'hrefArray', TRASH]);
|
|
|
|
var filesList = exp.getFiles([ROOT, 'hrefArray', TRASH]);
|
|
|
|
|
|
|
|
var toClean = [];
|
|
|
|
exp.getFiles([FILES_DATA]).forEach(function (id) {
|
|
|
|
exp.getFiles([FILES_DATA]).forEach(function (id) {
|
|
|
|
if (filesList.indexOf(id) === -1) {
|
|
|
|
if (filesList.indexOf(id) === -1) {
|
|
|
|
|
|
|
|
var fd = exp.getFileData(id);
|
|
|
|
|
|
|
|
if (fd && fd.href) {
|
|
|
|
|
|
|
|
toClean.push(Hash.hrefToHexChannelId(fd.href));
|
|
|
|
|
|
|
|
}
|
|
|
|
spliceFileData(id);
|
|
|
|
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) {
|
|
|
|
var deleteHrefs = function (ids) {
|
|
|
|
ids.forEach(function (obj) {
|
|
|
|
ids.forEach(function (obj) {
|
|
|
|