@@ -16,6 +16,7 @@ import {
16
16
useDisclosure ,
17
17
useToast ,
18
18
} from '@chakra-ui/react'
19
+ import { useQueryClient } from '@tanstack/react-query'
19
20
import { ElectionProvider , errorToString , useClient } from '@vocdoni/react-providers'
20
21
import {
21
22
ApprovalElection ,
@@ -45,6 +46,7 @@ import { CensusMeta } from '~components/Process/Census/CensusType'
45
46
import { StampsUnionTypes } from '~components/ProcessCreate/Census/Gitcoin/StampsUnionType'
46
47
import { CensusGitcoinValues } from '~components/ProcessCreate/StepForm/CensusGitcoin'
47
48
import { DefaultCensusSize } from '~constants'
49
+ import { QueryKeys } from '~src/queries/keys'
48
50
import { useCspAdmin } from '../Census/Csp/use-csp'
49
51
import Preview from '../Confirm/Preview'
50
52
import { CreationProgress , Steps } from '../CreationProgress'
@@ -66,6 +68,7 @@ export const Confirm = () => {
66
68
const [ created , setCreated ] = useState < string | null > ( null )
67
69
const [ step , setStep ] = useState < Steps > ( )
68
70
const { vocdoniAdminClient } = useCspAdmin ( )
71
+ const qclient = useQueryClient ( )
69
72
70
73
const methods = useForm ( {
71
74
defaultValues : {
@@ -131,6 +134,11 @@ export const Confirm = () => {
131
134
duration : 4000 ,
132
135
} )
133
136
137
+ // clear process list cache
138
+ qclient . resetQueries ( {
139
+ queryKey : QueryKeys . organization . elections ( ) ,
140
+ } )
141
+
134
142
// fetch account to update the election index and account balance
135
143
await fetchAccount ( )
136
144
0 commit comments