From 5e4f0a03f03292427b39460941e8519fe6768edc Mon Sep 17 00:00:00 2001 From: Micha Albert Date: Fri, 2 Aug 2024 16:22:22 +0000 Subject: [PATCH] fix active stream fetch call on frontend --- tiling-frontend/src/App.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tiling-frontend/src/App.svelte b/tiling-frontend/src/App.svelte index 48bb68b..4dc5a53 100644 --- a/tiling-frontend/src/App.svelte +++ b/tiling-frontend/src/App.svelte @@ -23,8 +23,9 @@ const activeStreamResponse = await fetch( "http://localhost:8000/api/v1/active_stream", ); - activeStream = (await activeStreamResponse.text()).replaceAll('"', "").split(",")[0]; - activeStreamerName = (await activeStreamResponse.text()).replaceAll('"', "").split(",")[1]; + const activeStreamResponseText = await activeStreamResponse.text() + activeStream = activeStreamResponseText.replaceAll('"', "").split(",")[0]; + activeStreamerName = activeStreamResponseText.replaceAll('"', "").split(",")[1]; // if (oldActiveStream !== null && oldActiveStream !== activeStream) { // window.location.reload(); // } @@ -110,7 +111,7 @@ autoplay id={path.name} bind:this={videos[path.name]} - class="max-h-[65vh] w-auto bg-red-500" + class="max-h-[65vh] w-auto" > {/if} {/each}