Skip to content

Commit

Permalink
Clear cache when chnaging collection
Browse files Browse the repository at this point in the history
Fixes #6116
  • Loading branch information
CarolineDenis committed Jan 23, 2025
1 parent 0c9839d commit 5d8fafa
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useAsyncState } from '../../hooks/useAsyncState';
import { toLocalUrl } from '../../utils/ajax/helpers';
import { ping } from '../../utils/ajax/ping';
import { formatUrl } from '../Router/queryString';
import { clearAllCache } from './CacheBuster';

export const switchCollection = (
navigate: SafeNavigateFunction,
Expand Down Expand Up @@ -40,7 +41,9 @@ export function SwitchCollectionCommand(): null {
method: 'POST',
body: collectionId!.toString(),
errorMode: 'dismissible',
}).then(() => globalThis.location.replace(nextUrl)),
})
.then(clearAllCache)
.then(() => globalThis.location.replace(nextUrl)),
[collectionId, nextUrl]
),
true
Expand Down

0 comments on commit 5d8fafa

Please sign in to comment.