Skip to content

Commit

Permalink
feat: add a warning when trying to open now playing navigation
Browse files Browse the repository at this point in the history
while there are no anime currently playing
  • Loading branch information
NoCrypt committed Aug 9, 2024
1 parent 7ab1594 commit 270a13c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/components/Navbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { click } from '@/modules/click.js'
import IPC from '@/modules/ipc.js'
import { rss } from '@/views/TorrentSearch/TorrentModal.svelte'
import { toast } from 'svelte-sonner';
const view = getContext('view')
export let page
const links = [
Expand Down Expand Up @@ -34,6 +35,7 @@
return
}
if ($media) $view = $media.media
else toast.error('No anime currently playing', {duration: 1300})
$rss = null
},
icon: 'queue_music',
Expand Down Expand Up @@ -82,7 +84,7 @@
<div
class='navbar-link navbar-link-with-icon pointer overflow-hidden mx-auto'
use:click={close}>
<span class='material-symbols-outlined rounded'>home</span>
<span class='material-symbols-outlined rounded' class:filled={page === 'home'}>home</span>
</div>

{#each links as { click: _click, icon, text, image, css, page: _page }, i (i)}
Expand Down Expand Up @@ -180,4 +182,7 @@
img {
margin-right: var(--sidebar-brand-image-margin-right);
}
.opacity-50{
opacity: 0.5;
}
</style>

0 comments on commit 270a13c

Please sign in to comment.