Revamp the FullNameHash system for better readable urls

And reduce the folders caching footprint.
And it reduces server load.
This commit is contained in:
djmaze 2021-12-07 14:03:30 +01:00
parent 76627ae2f6
commit 3a61bb3e5a
10 changed files with 90 additions and 78 deletions

View file

@ -657,20 +657,20 @@ class AppUser extends AbstractApp {
}
/**
* @param {string} sFullNameHash
* @param {string} sFullName
* @param {boolean} bExpanded
*/
setExpandedFolder(sFullNameHash, bExpanded) {
setExpandedFolder(sFullName, bExpanded) {
let aExpandedList = Local.get(ClientSideKeyName.ExpandedFolders);
if (!isArray(aExpandedList)) {
aExpandedList = [];
}
if (bExpanded) {
if (!aExpandedList.includes(sFullNameHash))
aExpandedList.push(sFullNameHash);
if (!aExpandedList.includes(sFullName))
aExpandedList.push(sFullName);
} else {
aExpandedList = aExpandedList.filter(value => value !== sFullNameHash);
aExpandedList = aExpandedList.filter(value => value !== sFullName);
}
Local.set(ClientSideKeyName.ExpandedFolders, aExpandedList);