Fix invisible restricted shared folders in teams

pull/1/head
yflory 4 years ago
parent 5ade53ebba
commit 1edfbadf4e

@ -1624,6 +1624,7 @@ define([
})) {}
var auth = function () {
if (!_store) { return void cb('ERESTRICTED'); }
var rpc = _store.rpc;
if (!rpc) { return void cb('ERESTRICTED'); }
rpc.send('COOKIE', '', function (err) {
@ -1632,7 +1633,7 @@ define([
};
// Wait for the RPC we need to be ready and then tyr to authenticate
if (_store.onRpcReadyEvt) {
if (_store && _store.onRpcReadyEvt) {
_store.onRpcReadyEvt.reg(function () {
auth();
});
@ -2851,6 +2852,12 @@ define([
drive[Constants.oldStorageKey] = [];
}
// Drive already exist: return the existing drive, don't load data from legacy store
if (store.manager) {
// If a cache is loading, make sure it is complete before calling onReady
return void onCacheReadyEvt.reg(function () {
onReady(clientId, returned, cb);
});
}
onReady(clientId, returned, cb);
})
.on('change', ['drive', 'migrate'], function () {

@ -17,7 +17,7 @@ define([
// Add a shared folder to the list
var addProxy = function (Env, id, lm, leave, editKey, force) {
if (Env.folders[id] && !force) {
if (Env.folders[id] && !force && !Env.folders[id].restricted) {
// Shared folder already added to the proxy-manager, probably
// a cached version
if (Env.folders[id].offline && !lm.cache) {
@ -26,6 +26,7 @@ define([
}
return;
}
if (Env.folders[id]) { console.warn(Env.folders[id]); }
var cfg = getConfig(Env);
cfg.sharedFolder = true;
cfg.id = id;
@ -48,6 +49,7 @@ define([
proxy: lm.proxy,
userObject: userObject,
leave: leave,
restricted: proxy.restricted,
offline: Boolean(lm.cache)
};
if (proxy.on) {

@ -42,7 +42,7 @@ define([
if (!drive || !drive.sharedFolders) {
return void cb();
}
var r = drive.restrictedFolders = drive.restrictedFolders || {};
var r = drive.restrictedFolders = {};
var oldIds = Object.keys(folders);
nThen(function (waitFor) {
Object.keys(drive.sharedFolders).forEach(function (fId) {

@ -61,7 +61,7 @@ define([
if (!drive || !drive.sharedFolders) {
return void cb();
}
var r = drive.restrictedFolders = drive.restrictedFolders || {};
var r = drive.restrictedFolders = {};
var oldIds = Object.keys(folders);
nThen(function (waitFor) {
Object.keys(drive.sharedFolders).forEach(function (fId) {
@ -76,7 +76,7 @@ define([
r[fId] = drive.sharedFolders[fId];
if (!r[fId].title) { r[fId].title = r[fId].lastTitle; }
}
if (newObj && (newObj.deprecated || newObj.restricted)) {
if (newObj && (newObj.deprecated /*|| newObj.restricted*/)) {
delete folders[fId];
delete drive.sharedFolders[fId];
if (manager && manager.folders) {

Loading…
Cancel
Save