[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 old image staying during DOM recycling

Kasper (Jun 1, 2025, 7:24 AM +0200) 8e6dbb5c eacd9e49

+22 -2
+22 -2
src/components/TrackList.svelte
··· 696 696 grid.hideAttribution = true 697 697 grid.rowClass = 'row_class' 698 698 }} 699 + {@attach (grid: HTMLRevoGridElement) => { 700 + // Apply `invisible` when an img.src get supdated, so that the old image 701 + // doesn't stick around when a DOM node is updated (e.g during scroll) 702 + const observer = new MutationObserver((mutationsList) => { 703 + for (const mutation of mutationsList) { 704 + if ( 705 + mutation.type === 'attributes' && 706 + mutation.attributeName === 'src' && 707 + (mutation.target as Element).tagName === 'IMG' 708 + ) { 709 + const img = mutation.target as HTMLImageElement 710 + img.classList.add('invisible') 711 + } 712 + } 713 + }) 714 + observer.observe(grid, { 715 + subtree: true, 716 + attributes: true, 717 + attributeFilter: ['src'], 718 + }) 719 + return () => observer.disconnect() 720 + }} 699 721 onkeydown={(e: KeyboardEvent & { currentTarget: Element }) => { 700 722 scroll_container_keydown(e) 701 723 keydown(e) ··· 811 833 .error.missing::before 812 834 cursor: default 813 835 background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><rect x="0" y="0" width="18" height="18" fill="%232b2c31" rx="2" ry="2"/><path fill="%2345464a" d="M12.667,5l-5.332,1.195l-0,4.347c-0.993,-0.197 -2.002,0.557 -2.002,1.384c0,0.713 0.557,1.074 1.162,1.074c0.718,-0 1.504,-0.509 1.505,-1.546l0,-3.633l4,-0.82l0,2.875c-0.992,-0.196 -2,0.554 -2,1.38c0,0.714 0.572,1.077 1.174,1.077c0.713,0 1.492,-0.508 1.493,-1.545l-0,-5.788Z"/></svg>'); 814 - .loading 815 - visibility: hidden 816 836 .rgRow 817 837 line-height: 24px 818 838 font-size: 12px