Skip to content

Fix audio autoplay crash from loading spinner state mismatch

jedmund requested to merge jedmund/fix-audio-autoplay into main

Summary

  • startFadeIn was setting playingFileId in an async .then() callback while loadingFileId was set synchronously, causing currentTrack to be undefined when Svelte resolved the template — triggering the "payload" error
  • Set playingFileId synchronously (matching playTrack behavior), add missing onTrackStart call for scrobble tracking, and clear state on autoplay block

Test plan

  • Open random page — album auto-plays first track with spinner during load
  • If autoplay is browser-blocked, no spinner persists and no console error
  • Click Skip — crossfade works correctly
  • Manually clicking a track still works
  • Build passes

Merge request reports

Loading