Skip to content

Commit

Permalink
Hide global folder if expert mode is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Dec 8, 2023
1 parent d6b7104 commit fe865da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 5 additions & 2 deletions src/src/SideMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit fe865da

Please sign in to comment.