Skip to content

Commit

Permalink
Merge pull request #2863 from ecency/nt/waves-refresh
Browse files Browse the repository at this point in the history
Nt/Waves Refresh
  • Loading branch information
feruzm authored Apr 23, 2024
2 parents 777b389 + d45eea3 commit b06aa86
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/providers/queries/postQueries/wavesQueries.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UseMutationOptions, useMutation, useQueries, useQueryClient } from '@tanstack/react-query';
import { QueryKey, UseMutationOptions, useMutation, useQueries, useQueryClient } from '@tanstack/react-query';
import { useEffect, useMemo, useRef, useState } from 'react';

import { unionBy, isArray } from 'lodash';
Expand Down Expand Up @@ -279,9 +279,16 @@ export const usePublishWaveMutation = () => {
const _host = cacheCommentData.parent_author;

// update query data
const queriesData = queryClient.getQueriesData([QUERIES.WAVES.INITIAL_CONTAINERS, _host]);
const _queryKey = queriesData[0][0];
const queryData: any[] | undefined = queryClient.getQueryData(_queryKey);
const containerQueriesData: [QueryKey, string[] | undefined][] = queryClient.getQueriesData([QUERIES.WAVES.INITIAL_CONTAINERS, _host]);

if (!containerQueriesData[0][1]) {
return;
}

//get query data of first waves container
const _containerKey: string = containerQueriesData[0][1][0];
const _queryKey = [QUERIES.WAVES.GET, _host, _containerKey, 0]
const queryData: any[] | undefined = queryClient.getQueryData(_queryKey)

console.log('query data', queryData);

Expand Down

0 comments on commit b06aa86

Please sign in to comment.