Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion frontend/hooks/useJoinDaoLlcMutation.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { StakeAccount, StakeConnection } from '@pythnetwork/staking'
import toast from 'react-hot-toast'
import { useMutation } from 'react-query'
import { useMutation, useQueryClient } from 'react-query'
import { StakeConnectionQueryKey } from './useStakeConnection'

export function useJoinDaoLlcMutation() {
const queryClient = useQueryClient()

return useMutation(
['sign-llc-mutation'],
async ({
Expand All @@ -16,6 +19,13 @@ export function useJoinDaoLlcMutation() {
toast.success(`Successfully signed LLC agreement!`)
},
{
onSuccess() {
// invalidate all except stake connection
queryClient.invalidateQueries({
predicate: (query) => query.queryKey[0] !== StakeConnectionQueryKey,
})
},

onError(error: Error) {
toast.error(error.message)
},
Expand Down
2 changes: 1 addition & 1 deletion staking/app/StakeConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ export class StakeConnection {
}

/**
* Join the DAO LLC for the give stake account.
* Join the DAO LLC for the given stake account.
*/
public async joinDaoLlc(stakeAccount: StakeAccount) {
const transaction: Transaction = new Transaction();
Expand Down