fix: invalidate tanstack caches on user auth (#5341)

* fix: invalidate tanstack caches on user auth

* refactor: clean up invalidate flow

* fix: lint
This commit is contained in:
Calum H.
2026-02-09 14:43:33 +00:00
committed by GitHub
parent e962521492
commit 90438a1ad5
16 changed files with 105 additions and 198 deletions

View File

@@ -166,7 +166,7 @@ export function createManageVersionContext(
): ManageVersionContextValue {
const { labrinth } = injectModrinthClient()
const { addNotification } = injectNotificationManager()
const { refreshVersions, projectV2 } = injectProjectPageContext()
const { invalidate, projectV2 } = injectProjectPageContext()
// State
const draftVersion = ref<Labrinth.Versions.v3.DraftVersion>(structuredClone(EMPTY_DRAFT_VERSION))
@@ -660,7 +660,7 @@ export function createManageVersionContext(
text: 'The version has been successfully added to your project.',
type: 'success',
})
await refreshVersions()
await invalidate()
onSave?.()
} catch (err: any) {
addNotification({
@@ -734,7 +734,7 @@ export function createManageVersionContext(
text: 'The version has been successfully saved to your project.',
type: 'success',
})
await refreshVersions()
await invalidate()
onSave?.()
} catch (err: any) {
addNotification({