TVDB özelliği eklendi.
This commit is contained in:
@@ -2,17 +2,24 @@
|
||||
import { Link } from "svelte-routing";
|
||||
import { createEventDispatcher, onDestroy } from "svelte";
|
||||
import { movieCount } from "../stores/movieStore.js";
|
||||
import { tvShowCount } from "../stores/tvStore.js";
|
||||
|
||||
export let menuOpen = false;
|
||||
const dispatch = createEventDispatcher();
|
||||
let hasMovies = false;
|
||||
let hasShows = false;
|
||||
|
||||
const unsubscribe = movieCount.subscribe((count) => {
|
||||
const unsubscribeMovie = movieCount.subscribe((count) => {
|
||||
hasMovies = (count ?? 0) > 0;
|
||||
});
|
||||
|
||||
const unsubscribeTv = tvShowCount.subscribe((count) => {
|
||||
hasShows = (count ?? 0) > 0;
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
unsubscribe();
|
||||
unsubscribeMovie();
|
||||
unsubscribeTv();
|
||||
});
|
||||
|
||||
// Menü öğesine tıklanınca sidebar'ı kapat
|
||||
@@ -51,6 +58,20 @@
|
||||
</Link>
|
||||
{/if}
|
||||
|
||||
{#if hasShows}
|
||||
<Link
|
||||
to="/tv"
|
||||
class="item"
|
||||
getProps={({ isCurrent }) => ({
|
||||
class: isCurrent ? "item active" : "item",
|
||||
})}
|
||||
on:click={handleLinkClick}
|
||||
>
|
||||
<i class="fa-solid fa-tv icon"></i>
|
||||
Tv Shows
|
||||
</Link>
|
||||
{/if}
|
||||
|
||||
<Link
|
||||
to="/transfers"
|
||||
class="item"
|
||||
|
||||
Reference in New Issue
Block a user