Fix: wg-easy threshold not properly computed (#3574)

This commit is contained in:
Conner Hnatiuk
2024-06-03 15:52:58 -06:00
committed by GitHub
parent 19c3ac0d7e
commit 67a69a5878
2 changed files with 10 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ export default function Component({ service }) {
const enabled = infoData.filter((item) => item.enabled).length;
const disabled = infoData.length - enabled;
const connectionThreshold = widget.threshold ?? 2 * 60 * 1000;
const connectionThreshold = (widget.threshold ?? 2) * 60 * 1000;
const currentTime = new Date();
const connected = infoData.filter(
(item) => currentTime - new Date(item.latestHandshakeAt) < connectionThreshold,