From 74d6ab0555e91a890fb86bfc72903a6912b9b078 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 3 Feb 2023 18:32:31 -0700 Subject: [PATCH] Fix copying logs (#5373) --- web/src/routes/Logs.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/routes/Logs.jsx b/web/src/routes/Logs.jsx index f38149955..def5469df 100644 --- a/web/src/routes/Logs.jsx +++ b/web/src/routes/Logs.jsx @@ -4,6 +4,7 @@ import { useCallback, useEffect, useState } from 'preact/hooks'; import ButtonsTabbed from '../components/ButtonsTabbed'; import useSWR from 'swr'; import Button from '../components/Button'; +import copy from 'copy-to-clipboard'; export default function Logs() { const [logService, setLogService] = useState('frigate'); @@ -14,10 +15,7 @@ export default function Logs() { const { data: nginxLogs } = useSWR('logs/nginx'); const handleCopyLogs = useCallback(() => { - async function copy() { - await window.navigator.clipboard.writeText(logs); - } - copy(); + copy(logs); }, [logs]); useEffect(() => {