Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

update swr config to not fetch everything on focus (#3350)

rahulramesha96868760a343
diff --git a/web/components/issues/issue-layouts/roots/project-layout-root.tsx b/web/components/issues/issue-layouts/roots/project-layout-root.tsx
index da9811c61a..bfff19cd8d 100644
--- a/web/components/issues/issue-layouts/roots/project-layout-root.tsx
+++ b/web/components/issues/issue-layouts/roots/project-layout-root.tsx
@@ -27,20 +27,12 @@ export const ProjectLayoutRoot: FC = observer(() => {
// hooks
const { issues, issuesFilter } = useIssues(EIssuesStoreType.PROJECT);
- const {} = useSWR(
- workspaceSlug && projectId ? `PROJECT_ISSUES_${workspaceSlug}_${projectId}` : null,
- async () => {
- if (workspaceSlug && projectId) {
- await issuesFilter?.fetchFilters(workspaceSlug.toString(), projectId.toString());
- await issues?.fetchIssues(
- workspaceSlug.toString(),
- projectId.toString(),
- issues?.groupedIssueIds ? "mutation" : "init-loader"
- );
- }
- },
- { revalidateOnFocus: false, refreshInterval: 600000, revalidateOnMount: true }
- );
+ useSWR(workspaceSlug && projectId ? `PROJECT_ISSUES_${workspaceSlug}_${projectId}` : null, async () => {
+ if (workspaceSlug && projectId) {
+ await issuesFilter?.fetchFilters(workspaceSlug.toString(), projectId.toString());
+ await issues?.fetchIssues(workspaceSlug.toString(), projectId.toString(), issues?.groupedIssueIds ? "mutation" : "init-loader");
+ }
+ });
const activeLayout = issuesFilter?.issueFilters?.displayFilters?.layout;
diff --git a/web/constants/swr-config.ts b/web/constants/swr-config.ts
index 063d5db54a..38478fcea3 100644
--- a/web/constants/swr-config.ts
+++ b/web/constants/swr-config.ts
@@ -1,5 +1,8 @@
export const SWR_CONFIG = {
refreshWhenHidden: false,
revalidateIfStale: false,
+ revalidateOnFocus: false,
+ revalidateOnMount: true,
+ refreshInterval: 600000,
errorRetryCount: 3,
};