Track tags are now refreshed correctly when editing from within an export folder

This commit is contained in:
patben8 committed 2026-09-28 21:25:37 +02:00
1 parent 86b26e3229
commit bd35418a89
5 files changed
+32 -24

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import type { QueryClient } from '@tanstack/react-query'
// Every query that lists COLLECTION tracks, i.e. everything a track edit can
// leave stale. One list, because each edit path used to name its own and the
// export views (added later) were missing from most of them — a rating set in
// an export's playlist did not show until the view was left and re-entered.
// A new view over collection tracks belongs here.
const TRACK_LIST_KEYS = [
['tracks'],
['playlist'],
['export-tracks'],
['export-playlist-tracks'],
['export-loose'],
] as const
/** Refetch every collection track list, plus the unsaved-edits state. */
export function invalidateTrackLists(qc: QueryClient) {
for (const queryKey of TRACK_LIST_KEYS) qc.invalidateQueries({ queryKey })
qc.invalidateQueries({ queryKey: ['state'] })
}