Fix shared folder password change with the cache

pull/1/head
yflory 4 years ago
parent 1f7aca39ab
commit d12603c50a

@ -197,7 +197,12 @@ define([
// 1. addProxy won't re-add the same folder twice on 'ready' // 1. addProxy won't re-add the same folder twice on 'ready'
// 2. obj.cb is using Util.once // 2. obj.cb is using Util.once
rt.cache = true; rt.cache = true;
obj.store.manager.addProxy(obj.id, rt, leave, obj.secondaryKey);
// If we're updating the password of an existing folder, force the creation
// of a new userobject in proxy-manager. Once it's done, remove this flag
// to make sure we won't create a second new userobject on 'ready'
obj.store.manager.addProxy(obj.id, rt, leave, obj.secondaryKey, config.updatePassword);
config.updatePassword = false;
obj.cb(sf.rt); obj.cb(sf.rt);
}); });
sf.ready = true; sf.ready = true;
@ -220,7 +225,7 @@ define([
}); });
*/ */
rt.cache = false; rt.cache = false;
obj.store.manager.addProxy(obj.id, rt, leave, obj.secondaryKey); obj.store.manager.addProxy(obj.id, rt, leave, obj.secondaryKey, config.updatePassword);
obj.cb(sf.rt); obj.cb(sf.rt);
}); });
sf.ready = true; sf.ready = true;
@ -324,6 +329,7 @@ define([
SF.load({ SF.load({
network: network, network: network,
store: s, store: s,
updatePassword: true,
isNewChannel: Store.isNewChannel isNewChannel: Store.isNewChannel
}, sfId, sf, waitFor()); }, sfId, sf, waitFor());
if (!s.rpc) { return; } if (!s.rpc) { return; }

@ -16,8 +16,8 @@ define([
}; };
// Add a shared folder to the list // Add a shared folder to the list
var addProxy = function (Env, id, lm, leave, editKey) { var addProxy = function (Env, id, lm, leave, editKey, force) {
if (Env.folders[id]) { if (Env.folders[id] && !force) {
// Shared folder already added to the proxy-manager, probably // Shared folder already added to the proxy-manager, probably
// a cached version // a cached version
if (Env.folders[id].offline && !lm.cache) { if (Env.folders[id].offline && !lm.cache) {

Loading…
Cancel
Save