Browse Source

hide non-working ui parts

master
gelaechter 3 years ago
committed by Jeff
parent
commit
bcb06f460d
  1. 5
      src/components/layout/Sidebar.tsx
  2. 10
      src/components/settings/Config.tsx

5
src/components/layout/Sidebar.tsx

@ -1,6 +1,7 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import { Sidenav, Nav, Icon } from 'rsuite';
import { useAppSelector } from '../../redux/hooks';
import { FixedSidebar, SidebarNavItem } from './styled';
const Sidebar = ({
@ -129,6 +130,8 @@ const Sidebar = ({
>
Genres
</SidebarNavItem>
{useAppSelector((state) => state.config).serverType !== 'funkwhale' && (
<>
<SidebarNavItem
tabIndex={0}
eventKey="folders"
@ -143,6 +146,8 @@ const Sidebar = ({
>
Folders
</SidebarNavItem>
</>
)}
</Nav>
<Nav>
<SidebarNavItem

10
src/components/settings/Config.tsx

@ -40,6 +40,9 @@ const Config = () => {
}, []);
useEffect(() => {
// skip scan status if server type is funkwhale
if (config.serverType === 'funkwhale') return setScanProgress(0);
// Check scan status on render
apiController({ serverType: config.serverType, endpoint: 'getScanStatus' })
.then((status) => {
@ -53,6 +56,9 @@ const Config = () => {
}, [config.serverType]);
useEffect(() => {
// skip scan status if server type is funkwhale
if (config.serverType === 'funkwhale') return setScanProgress(0);
// Reload scan status on interval during scan
if (isScanning) {
const interval = setInterval(() => {
@ -125,6 +131,8 @@ const Config = () => {
sidetitle={<DisconnectButton />}
subsidetitle={
<ButtonToolbar>
{useAppSelector((state) => state.config).serverType !== 'funkwhale' && (
<>
<StyledButton
size="sm"
onClick={async () => {
@ -139,6 +147,8 @@ const Config = () => {
>
{isScanning ? `${scanProgress}` : 'Scan'}
</StyledButton>
</>
)}
<Whisper
trigger="click"
placement="auto"

Loading…
Cancel
Save