Quick FIX

This commit is contained in:
Jannes Vandepitte
2022-08-31 18:00:10 +02:00
parent 12e7eb6357
commit 4b2cd519f7

View File

@@ -18,6 +18,7 @@ import { SortableAppShelfItem, AppShelfItem } from './AppShelfItem';
import { ModuleMenu, ModuleWrapper } from '../../modules/moduleWrapper'; import { ModuleMenu, ModuleWrapper } from '../../modules/moduleWrapper';
import { UsenetModule, TorrentsModule } from '../../modules'; import { UsenetModule, TorrentsModule } from '../../modules';
import TorrentsComponent from '../../modules/torrents/TorrentsModule'; import TorrentsComponent from '../../modules/torrents/TorrentsModule';
import UsenetComponent from '../../modules/usenet/UsenetModule';
const AppShelf = (props: any) => { const AppShelf = (props: any) => {
const { config, setConfig } = useConfig(); const { config, setConfig } = useConfig();
@@ -126,7 +127,11 @@ const AppShelf = (props: any) => {
const noCategory = config.services.filter( const noCategory = config.services.filter(
(e) => e.category === undefined || e.category === null (e) => e.category === undefined || e.category === null
); );
const downloadEnabled = config.modules?.[TorrentsModule.id]?.enabled ?? false;
const usenetEnabled = config.modules?.[TorrentsModule.id]?.enabled ?? false;
const torrentEnabled = config.modules?.[UsenetModule.id]?.enabled ?? false;
const downloadEnabled = usenetEnabled || torrentEnabled;
// Create an item with 0: true, 1: true, 2: true... For each category // Create an item with 0: true, 1: true, 2: true... For each category
return ( return (
// TODO: Style accordion so that the bar is transparent to the user settings // TODO: Style accordion so that the bar is transparent to the user settings
@@ -170,8 +175,18 @@ const AppShelf = (props: any) => {
${(config.settings.appOpacity || 100) / 100}`, ${(config.settings.appOpacity || 100) / 100}`,
}} }}
> >
{torrentEnabled && (
<>
<ModuleMenu module={TorrentsModule} /> <ModuleMenu module={TorrentsModule} />
<TorrentsComponent /> <TorrentsComponent />
</>
)}
{usenetEnabled && (
<>
<ModuleMenu module={UsenetModule} />
<UsenetComponent />
</>
)}
</Paper> </Paper>
</Accordion.Panel> </Accordion.Panel>
</Accordion.Item> </Accordion.Item>