Fix revalidation

This commit is contained in:
Hongbo Wu
2023-05-15 21:46:11 +08:00
parent a842fecf7f
commit 87ef6f2d01
2 changed files with 4 additions and 3 deletions

View File

@ -71,7 +71,8 @@ export function useGetIntegrationsQuery(): IntegrationsQueryResponse {
return {
isValidating: false,
integrations: [],
// eslint-disable-next-line @typescript-eslint/no-empty-function
revalidate: () => {},
revalidate: () => {
mutate()
},
}
}

View File

@ -112,6 +112,7 @@ export default function Integrations(): JSX.Element {
enabled: true,
})
if (result) {
revalidate()
showSuccessToast('Connected with Pocket.')
} else {
showErrorToast('There was an error connecting to Pocket.')
@ -120,7 +121,6 @@ export default function Integrations(): JSX.Element {
showErrorToast('Error: ' + err)
} finally {
router.replace('/settings/integrations')
revalidate()
}
}
if (!router.isReady) return