added sse

main
alex 2023-09-11 23:08:57 +02:00
parent 3576ecb258
commit 5624ea9dc2
1 changed files with 1 additions and 0 deletions

View File

@ -81,6 +81,7 @@ export default function LogCard({
currentDate.getMonth() + 1 currentDate.getMonth() + 1
}-${currentDate.getFullYear()}`; }-${currentDate.getFullYear()}`;
// only open the sse connection if the selected date is today
if (selectedDate === today) { if (selectedDate === today) {
sseEventSource.current = new EventSource( sseEventSource.current = new EventSource(
`${logApiAddress}/sse/${type}/${selectedDate}` `${logApiAddress}/sse/${type}/${selectedDate}`