From b15c74e09dcd870a5031b39d04206c718f5e6c93 Mon Sep 17 00:00:00 2001 From: "Thomas \"ajnart\" Camlong" Date: Sat, 30 Apr 2022 21:38:04 +0200 Subject: [PATCH] Make simple qbittorrent switch This will be used later to ping services --- components/AppShelf/AppShelf.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/AppShelf/AppShelf.tsx b/components/AppShelf/AppShelf.tsx index 6710ed251..e7c901bca 100644 --- a/components/AppShelf/AppShelf.tsx +++ b/components/AppShelf/AppShelf.tsx @@ -11,12 +11,13 @@ import { createStyles, Center, } from '@mantine/core'; +import { showNotification } from '@mantine/notifications'; +import { AlertCircle, Cross, X } from 'tabler-icons-react'; import { serviceItem } from './AppShelf.d'; import AppShelfMenu from './AppShelfMenu'; import AddItemShelfItem from './AddAppShelfItem'; -import { showNotification } from '@mantine/notifications'; -import { AlertCircle, Cross, X } from 'tabler-icons-react'; import { useServices } from '../../tools/state'; +import { pingQbittorrent } from '../../tools/api'; const useStyles = createStyles((theme) => ({ main: { @@ -42,9 +43,14 @@ const AppShelf = (props: any) => { setServicesState(JSON.parse(localServices)); } }, []); + services.forEach((service) => { + if (service.type === 'qBittorrent') { + pingQbittorrent(service); + } + }); return ( - + {services.map((service, i) => (