wip no more next track

This commit is contained in:
wryk 2020-03-06 13:32:15 +01:00
parent 6ea7de42f4
commit 82f382099e
2 changed files with 10 additions and 4 deletions

View File

@ -3,10 +3,10 @@
<div class="queue__sectionTitle">Next song</div> <div class="queue__sectionTitle">Next song</div>
<div class="track"> <div class="track">
<div class="track__main" on:click={() => select($next)}> <div class="track__main" on:click={() => select($next)}>
<div class="track__title" class:placeholder={!$next}> <div class="track__title" class:placeholder={!$next && $enqueueing}>
{#if $next}{$next.media.title}{/if} {#if $next}{$next.media.title}{/if}
</div> </div>
<div class="track__subtitle" class:placeholder={!$next}> <div class="track__subtitle" class:placeholder={!$next && $enqueueing}>
{#if $next} {#if $next}
shared by <span class="track__username">{$next.referer.username}</span> shared by <span class="track__username">{$next.referer.username}</span>
<DistanceDate date={$next.referer.date} /> <DistanceDate date={$next.referer.date} />

View File

@ -81,8 +81,14 @@
$iterator.next().then(({ done, value }) => { $iterator.next().then(({ done, value }) => {
enqueueing.set(false) enqueueing.set(false)
$next = value
set($next) if (done) {
console.log('done')
set(null)
} else {
$next = value
set($next)
}
}).catch(console.error) }).catch(console.error)
} }
}) })