mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
update swr config to not fetch everything on focus (#3350)
Co-authored-by: Rahul R <rahulr@Rahuls-MacBook-Pro.local>
This commit is contained in:
parent
df97b35a99
commit
96868760a3
@ -27,20 +27,12 @@ export const ProjectLayoutRoot: FC = observer(() => {
|
|||||||
// hooks
|
// hooks
|
||||||
const { issues, issuesFilter } = useIssues(EIssuesStoreType.PROJECT);
|
const { issues, issuesFilter } = useIssues(EIssuesStoreType.PROJECT);
|
||||||
|
|
||||||
const {} = useSWR(
|
useSWR(workspaceSlug && projectId ? `PROJECT_ISSUES_${workspaceSlug}_${projectId}` : null, async () => {
|
||||||
workspaceSlug && projectId ? `PROJECT_ISSUES_${workspaceSlug}_${projectId}` : null,
|
|
||||||
async () => {
|
|
||||||
if (workspaceSlug && projectId) {
|
if (workspaceSlug && projectId) {
|
||||||
await issuesFilter?.fetchFilters(workspaceSlug.toString(), projectId.toString());
|
await issuesFilter?.fetchFilters(workspaceSlug.toString(), projectId.toString());
|
||||||
await issues?.fetchIssues(
|
await issues?.fetchIssues(workspaceSlug.toString(), projectId.toString(), issues?.groupedIssueIds ? "mutation" : "init-loader");
|
||||||
workspaceSlug.toString(),
|
|
||||||
projectId.toString(),
|
|
||||||
issues?.groupedIssueIds ? "mutation" : "init-loader"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
{ revalidateOnFocus: false, refreshInterval: 600000, revalidateOnMount: true }
|
|
||||||
);
|
|
||||||
|
|
||||||
const activeLayout = issuesFilter?.issueFilters?.displayFilters?.layout;
|
const activeLayout = issuesFilter?.issueFilters?.displayFilters?.layout;
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
export const SWR_CONFIG = {
|
export const SWR_CONFIG = {
|
||||||
refreshWhenHidden: false,
|
refreshWhenHidden: false,
|
||||||
revalidateIfStale: false,
|
revalidateIfStale: false,
|
||||||
|
revalidateOnFocus: false,
|
||||||
|
revalidateOnMount: true,
|
||||||
|
refreshInterval: 600000,
|
||||||
errorRetryCount: 3,
|
errorRetryCount: 3,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user