Skip to content

Commit

Permalink
[WALL] wojtek/limit unnecessary calls in order to avoid race hazards (#…
Browse files Browse the repository at this point in the history
…13063)

* feat: disabled auto reloading of stuff

* feat: moved config to individual queries
  • Loading branch information
azmib-developer authored Jan 24, 2024
1 parent 2a6447d commit 0321e6f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/api/src/hooks/useAuthorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ const useAuthorize = () => {

const { data, ...rest } = useQuery('authorize', {
payload: { authorize: current_token || '' },
options: { enabled: Boolean(current_token) },
options: {
enabled: Boolean(current_token),
// for authorise request - we cannot affort any race hazards due to it being randomly triggered
// e.g. during the process of swithcing account or smth
refetchOnWindowFocus: false,
refetchOnReconnect: false,
refetchOnMount: false,
},
});

// Add additional information to the authorize response.
Expand Down

1 comment on commit 0321e6f

@vercel
Copy link

@vercel vercel bot commented on 0321e6f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

deriv-app.vercel.app
binary.sx
deriv-app.binary.sx
deriv-app-git-master.binary.sx

Please sign in to comment.