From 60e9efdd3b0b2a2e93230826b72648509f43d933 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 7 Jul 2020 15:59:13 +0200 Subject: [PATCH] Fix sort issue with folders --- www/common/drive-ui.js | 7 +++++-- www/common/proxy-manager.js | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 0d3e49169..be0bea14a 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -2904,10 +2904,12 @@ define([ var el = useId ? _el : root[_el]; var sfId = (el && el.root && el.key) ? el.root[el.key] : el; if (folder && el && manager.isSharedFolder(sfId)) { - var title = manager.getSharedFolderData(sfId).title || el; + var sfData = manager.getSharedFolderData(sfId); + var title = sfData.title || sfData.lastTitle || el; return String(title).toLowerCase(); } else if (folder) { - return String((el && el.key) || el).toLowerCase(); + console.log(el); + return String((el && el.key) || _el).toLowerCase(); } var data = manager.getFileData(el); if (!data) { return ''; } @@ -2928,6 +2930,7 @@ define([ } props[uid] = getProp(k); }); + if (folder) { console.error(useId, props); } keys.sort(function(a, b) { var _a = props[(a && a.uid) || a]; var _b = props[(b && b.uid) || b]; diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js index 7211df88c..9378680c7 100644 --- a/www/common/proxy-manager.js +++ b/www/common/proxy-manager.js @@ -926,9 +926,8 @@ define([ if (!resolved.id) { var el = Env.user.userObject.find(resolved.path); if (Env.user.userObject.isSharedFolder(el) && Env.folders[el]) { - var oldName = Env.folders[el].proxy.metadata.title; Env.folders[el].proxy.metadata.title = data.newName; - Env.user.proxy[UserObject.SHARED_FOLDERS][el].lastTitle = oldName; + Env.user.proxy[UserObject.SHARED_FOLDERS][el].lastTitle = data.newName; return void cb(); } }