[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix queue not refreshing after toggling history

Kasper (Oct 26, 2024, 2:54 AM +0200) d02b8895 0d0f06ee

+14 -7
+1
CHANGELOG.md
··· 2 2 3 3 ## Next 4 4 - Fix queue panel deleting/moving incorrect tracks 5 + - Fix queue not refreshing after toggling history 5 6 6 7 ## 0.19.1 - 2024 Oct 25 7 8 - Fix folder playlists not closing
+13 -7
src/components/Queue.svelte
··· 7 7 queue, 8 8 type QueueItem, 9 9 } from '../lib/queue' 10 - import { onDestroy } from 'svelte' 10 + import { onDestroy, tick } from 'svelte' 11 11 import QueueItemComponent from './QueueItem.svelte' 12 12 import { dragged } from '@/lib/drag-drop' 13 13 import { get_track } from '@/lib/data' ··· 34 34 $: first_visible_index = show_history ? 0 : up_next_index 35 35 $: autoplay_index = up_next_index + $queue.user_queue.length 36 36 37 - let history_list: VirtualListBlock<QueueItem> 38 - let up_next_list: VirtualListBlock<QueueItem> 37 + let history_list: VirtualListBlock<QueueItem> | null 38 + let up_next_list: VirtualListBlock<QueueItem> | null 39 39 let autoplay_list: VirtualListBlock<QueueItem> 40 40 41 41 let visible_qids = [ ··· 54 54 scroll_to: ({ index }) => { 55 55 if (show_history) { 56 56 if (index < $queue.past.length) { 57 - return history_list.scroll_to_index(index, 40) 57 + return history_list?.scroll_to_index(index, 40) 58 58 } 59 59 index -= $queue.past.length 60 60 if ($queue.current && index === 0) { 61 - return history_list.scroll_to_index(index, 40) 61 + return history_list?.scroll_to_index(index, 40) 62 62 } 63 63 index -= Number(!!$queue.current) 64 64 } 65 65 if (index < $queue.user_queue.length) { 66 - return up_next_list.scroll_to_index(index, 40) 66 + return up_next_list?.scroll_to_index(index, 40) 67 67 } 68 68 index -= $queue.user_queue.length 69 69 autoplay_list.scroll_to_index(index, 40) ··· 202 202 <div class="relative"> 203 203 <div class="sticky top-0 z-1 flex flex h-[40px] items-center bg-black/50 backdrop-blur-md"> 204 204 <button 205 - on:click={() => (show_history = !show_history)} 205 + on:click={() => { 206 + show_history = !show_history 207 + tick().then(() => { 208 + up_next_list?.refresh() 209 + autoplay_list.refresh() 210 + }) 211 + }} 206 212 class="group ml-1.5 flex h-full items-center pl-1 font-semibold" 207 213 tabindex="-1" 208 214 on:mousedown|preventDefault