From 5f8a420c83fb82eca1a35874b53c19011160464a Mon Sep 17 00:00:00 2001 From: Meierschlumpf Date: Wed, 21 Dec 2022 20:47:08 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20torrent=20network=20traffi?= =?UTF-8?q?c=20widget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx b/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx index bb55d6b30..6b5ee7d7d 100644 --- a/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx +++ b/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx @@ -38,7 +38,7 @@ function TorrentNetworkTrafficTile({ widget }: TorrentNetworkTrafficTileProps) { const { t } = useTranslation(`modules/${definition.id}`); const { colors } = useMantineTheme(); const setSafeInterval = useSetSafeInterval(); - const { config } = useConfigContext(); + const { configVersion, config } = useConfigContext(); const [torrentHistory, torrentHistoryHandlers] = useListState([]); const [torrents, setTorrents] = useState([]); @@ -63,6 +63,7 @@ function TorrentNetworkTrafficTile({ widget }: TorrentNetworkTrafficTileProps) { setTorrents(response.data); }) .catch((error) => { + if (error.status === 401) return; setTorrents([]); // eslint-disable-next-line no-console console.error('Error while fetching torrents', error.response.data); @@ -78,7 +79,7 @@ function TorrentNetworkTrafficTile({ widget }: TorrentNetworkTrafficTileProps) { clearInterval(interval); }); }, 1000); - }, [config?.apps]); + }, [configVersion]); useEffect(() => { torrentHistoryHandlers.append({