Fix inconsistency between SF title in the tree and in the content

pull/1/head
yflory 4 years ago
parent b7a492a11b
commit d3db915927

@ -3945,7 +3945,8 @@ define([
var newRoot = Util.find(manager, ['folders', sfId, 'proxy', manager.user.userObject.ROOT]) || {}; var newRoot = Util.find(manager, ['folders', sfId, 'proxy', manager.user.userObject.ROOT]) || {};
subfolder = manager.hasSubfolder(newRoot); subfolder = manager.hasSubfolder(newRoot);
// Fix name // Fix name
key = manager.getSharedFolderData(sfId).title || Messages.fm_deletedFolder; var sfData = manager.getSharedFolderData(sfId);
key = sfData.title || sfData.lastTitle || Messages.fm_deletedFolder;
// Fix icon // Fix icon
$icon = isCurrentFolder ? $sharedFolderOpenedIcon : $sharedFolderIcon; $icon = isCurrentFolder ? $sharedFolderOpenedIcon : $sharedFolderIcon;
isSharedFolder = sfId; isSharedFolder = sfId;

@ -973,8 +973,8 @@ define([
if (!resolved.id) { if (!resolved.id) {
var el = Env.user.userObject.find(resolved.path); var el = Env.user.userObject.find(resolved.path);
if (Env.user.userObject.isSharedFolder(el) && Env.folders[el]) { if (Env.user.userObject.isSharedFolder(el) && Env.folders[el]) {
Env.folders[el].proxy.metadata.title = data.newName; Env.folders[el].proxy.metadata.title = data.newName || Messages.fm_folder;
Env.user.proxy[UserObject.SHARED_FOLDERS][el].lastTitle = data.newName; Env.user.proxy[UserObject.SHARED_FOLDERS][el].lastTitle = data.newName || Messages.fm_folder;
return void cb(); return void cb();
} }
} }

Loading…
Cancel
Save