Skip to content

Commit

Permalink
Fix copying logs
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 authored Feb 3, 2023
1 parent 66881eb commit f47ef24
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions web/src/routes/Logs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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(() => {
Expand Down

0 comments on commit f47ef24

Please sign in to comment.