diff --git a/CHANGELOG.md b/CHANGELOG.md index 38d6291..120b7f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Next - Fix queue panel deleting/moving incorrect tracks +- Fix queue not refreshing after toggling history ## 0.19.1 - 2024 Oct 25 - Fix folder playlists not closing diff --git a/src/components/Queue.svelte b/src/components/Queue.svelte index c38fdc1..02a572e 100644 --- a/src/components/Queue.svelte +++ b/src/components/Queue.svelte @@ -7,7 +7,7 @@ queue, type QueueItem, } from '../lib/queue' - import { onDestroy } from 'svelte' + import { onDestroy, tick } from 'svelte' import QueueItemComponent from './QueueItem.svelte' import { dragged } from '@/lib/drag-drop' import { get_track } from '@/lib/data' @@ -34,8 +34,8 @@ $: first_visible_index = show_history ? 0 : up_next_index $: autoplay_index = up_next_index + $queue.user_queue.length - let history_list: VirtualListBlock - let up_next_list: VirtualListBlock + let history_list: VirtualListBlock | null + let up_next_list: VirtualListBlock | null let autoplay_list: VirtualListBlock let visible_qids = [ @@ -54,16 +54,16 @@ scroll_to: ({ index }) => { if (show_history) { if (index < $queue.past.length) { - return history_list.scroll_to_index(index, 40) + return history_list?.scroll_to_index(index, 40) } index -= $queue.past.length if ($queue.current && index === 0) { - return history_list.scroll_to_index(index, 40) + return history_list?.scroll_to_index(index, 40) } index -= Number(!!$queue.current) } if (index < $queue.user_queue.length) { - return up_next_list.scroll_to_index(index, 40) + return up_next_list?.scroll_to_index(index, 40) } index -= $queue.user_queue.length autoplay_list.scroll_to_index(index, 40) @@ -202,7 +202,13 @@