Skip to content

Commit ca793d5

Browse files
fix(lightspeed): disable automatic model refetch on window focus (#3096)
* fix(lightspeed): disable automatic refetch on window focus Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> * adding changeset Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> --------- Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
1 parent ff3b8ab commit ca793d5

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-lightspeed': patch
3+
---
4+
5+
Disable automatic model refetch on window focus to prevent unnecessary network requests

workspaces/lightspeed/plugins/lightspeed/src/hooks/useAllModels.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ export const useAllModels = (): UseQueryResult<LCSModel[], Error> => {
3131
return response;
3232
},
3333
staleTime: 1000 * 60 * 5, // 5 minutes
34+
refetchOnWindowFocus: false,
3435
});
3536
};

0 commit comments

Comments
 (0)