mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Track tags are now refreshed correctly when editing from within an export folder
This commit is contained in:
1 parent
86b26e3229
commit
bd35418a89
5 files changed
+32
-24
No files matched your search
@@ -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'] })
|
||||
}
|
||||
Reference in new issue
Block a user