From fe865da79e386ca0cf59226682d32be8798c6cad Mon Sep 17 00:00:00 2001 From: Matthias Kleine Date: Fri, 8 Dec 2023 10:48:31 +0100 Subject: [PATCH] Hide global folder if expert mode is disabled --- README.md | 1 + src/src/SideMenu.jsx | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f04456d..7fb5bb54 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Since v5.5.0 of the JavaScript adapter the following locations (relative to the * (klein0r) Download script as xml file (export) * (klein0r) Import script as file (upload) +* (klein0r) Hide global folder if expert mode is disabled ### 7.3.0 (2023-12-07) diff --git a/src/src/SideMenu.jsx b/src/src/SideMenu.jsx index d259250a..6d8be278 100644 --- a/src/src/SideMenu.jsx +++ b/src/src/SideMenu.jsx @@ -1415,8 +1415,11 @@ class SideDrawer extends React.Component { getFolders() { const folders = [{ id: ROOT_ID, name: I18n.t('Root folder') }]; - this.state.listItems.forEach(item => - item.type === 'folder' && item.id !== ROOT_ID && folders.push({ id: item.id, name: item.title })); + this.state.listItems.forEach(item => { + if (!item.id.startsWith(GLOBAL_ID) || this.state.expertMode) { + item.type === 'folder' && item.id !== ROOT_ID && folders.push({ id: item.id, name: item.title }); + } + }); return folders; }