From ba5284c116bdc171c9727d0ae6ce62d6c2cd608a Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 25 May 2021 11:48:40 +0200 Subject: [PATCH 1/2] Fix getSharedFolderData --- www/common/proxy-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js index 9371b9e8b..51fda924f 100644 --- a/www/common/proxy-manager.js +++ b/www/common/proxy-manager.js @@ -237,7 +237,7 @@ define([ var getSharedFolderData = function (Env, id) { if (!Env.folders[id]) { return {}; } - var obj = Env.folders[id].proxy.metadata || {}; + var obj = Util.clone(Env.folders[id].proxy.metadata || {}); for (var k in Env.user.proxy[UserObject.SHARED_FOLDERS][id] || {}) { if (typeof(Env.user.proxy[UserObject.SHARED_FOLDERS][id][k]) === "undefined") { // XXX "deleted folder" for restricted shared folders when viewer in a team continue; From 84ec461542c5e17e2717e002fc589e18d24c1042 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 25 May 2021 14:37:58 +0200 Subject: [PATCH 2/2] Clean deprecated values in shared folders metadata --- www/common/proxy-manager.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js index 51fda924f..0b19e9020 100644 --- a/www/common/proxy-manager.js +++ b/www/common/proxy-manager.js @@ -237,7 +237,15 @@ define([ var getSharedFolderData = function (Env, id) { if (!Env.folders[id]) { return {}; } - var obj = Util.clone(Env.folders[id].proxy.metadata || {}); + var proxy = Env.folders[id].proxy; + + // Clean deprecated values + if (Object.keys(proxy.metadata || {}).length > 1) { + proxy.metadata = { title: proxy.metadata.title; } + } + + var obj = Util.clone(proxy.metadata || {}); + for (var k in Env.user.proxy[UserObject.SHARED_FOLDERS][id] || {}) { if (typeof(Env.user.proxy[UserObject.SHARED_FOLDERS][id][k]) === "undefined") { // XXX "deleted folder" for restricted shared folders when viewer in a team continue;