mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-21 08:15:36 +02:00
feat: add loading bar component and integrate it into TV shows and recommendations loading states and cache metadataprovider responsens in backend
This commit is contained in:
21
web/src/lib/components/loading-bar.svelte
Normal file
21
web/src/lib/components/loading-bar.svelte
Normal file
@@ -0,0 +1,21 @@
|
||||
<script lang="ts">
|
||||
import {Progress} from "$lib/components/ui/progress/index.js";
|
||||
import {onMount} from "svelte";
|
||||
|
||||
let value = $state(0);
|
||||
|
||||
onMount(() => {
|
||||
const interval = setInterval(() => {
|
||||
value += 1;
|
||||
if (value >= 100) {
|
||||
value = 0
|
||||
clearInterval(interval);
|
||||
|
||||
}
|
||||
}, 1);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Progress value={value}/>
|
||||
Reference in New Issue
Block a user