mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
fix(seekbar): blank canvas after update from legacy build (#432)
After PR #316 split the 'waveform' seekbar style into 'truewave' / 'pseudowave', users who carried any other unrecognised persisted value (legacy variants, undefined, tampered strings) ended up with a blank seekbar — the rehydrate migration matched only the literal 'waveform' string, and the drawSeekbar dispatcher had no default branch, so an unknown style drew nothing. Two-layer fix: * authStore migration now treats *any* value not in the current SeekbarStyle union as legacy and resets it to 'truewave'. * drawSeekbar gains a default case that falls back to the truewave renderer, so even if a future style mismatch slips through the store-level guard the user still sees a usable seekbar. Visible to affected users on next app start (rehydrate runs once per session). Clicking a style in Settings has always worked around the issue; this fix removes that workaround.
This commit is contained in:
committed by
GitHub
parent
0785385c7f
commit
fca8fc5318
@@ -785,6 +785,10 @@ export function drawSeekbar(
|
||||
case 'particletrail': drawParticleTrail(canvas, progress, buffered, anim); break;
|
||||
case 'liquidfill': drawLiquidFill(canvas, progress, buffered, anim); break;
|
||||
case 'retrotape': drawRetroTape(canvas, progress, buffered, anim); break;
|
||||
// Safety net: if a legacy or tampered persisted style sneaks past the
|
||||
// authStore migration, fall back to the truewave renderer instead of
|
||||
// leaving a blank canvas.
|
||||
default: drawWaveform(canvas, heights, progress, buffered); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user