Skip to content

Commit

Permalink
chore: prevent page refresh while polling (#1233)
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhart1o1 authored Jan 9, 2025
1 parent 28a3017 commit 13181c1
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
CreditFacility,
CreditFacilityStatus,
GetCreditFacilityBasicDetailsDocument,
GetCreditFacilityDisbursalsDocument,
GetCreditFacilityOverviewDocument,
GetCreditFacilityTransactionsDocument,
useGetCreditFacilityBasicDetailsQuery,
Expand Down Expand Up @@ -91,13 +90,20 @@ export default function CreditFacilityLayout({
data?.creditFacility?.approvalProcess?.status === ApprovalProcessStatus.Approved
) {
const timer = setInterval(() => {
client.refetchQueries({
include: [
GetCreditFacilityTransactionsDocument,
GetCreditFacilityBasicDetailsDocument,
GetCreditFacilityOverviewDocument,
GetCreditFacilityDisbursalsDocument,
],
client.query({
query: GetCreditFacilityBasicDetailsDocument,
variables: { id: creditFacilityId },
fetchPolicy: "network-only",
})
client.query({
query: GetCreditFacilityOverviewDocument,
variables: { id: creditFacilityId },
fetchPolicy: "network-only",
})
client.query({
query: GetCreditFacilityTransactionsDocument,
variables: { id: creditFacilityId },
fetchPolicy: "network-only",
})
}, 3000)

Expand Down

0 comments on commit 13181c1

Please sign in to comment.