[WEB-1724] fix: initial pages list loading. (#4939)

* [WEB-1724] fix: inital page loading.

* chore: update getPageById action.

* fix: lint error
This commit is contained in:
Prateek Shourya 2024-06-26 14:19:22 +05:30 committed by GitHub
parent a3a1e9cf9e
commit 4e97fcd776
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 18 additions and 14 deletions

View file

@ -31,7 +31,7 @@ export const InboxIssueRoot: FC<TInboxIssueRoot> = observer((props) => {
useEffect(() => {
if (!inboxAccessible || !workspaceSlug || !projectId) return;
if (navigationTab && navigationTab !== currentTab) {
handleCurrentTab(navigationTab);
handleCurrentTab(workspaceSlug, projectId, navigationTab);
} else {
fetchInboxIssues(workspaceSlug.toString(), projectId.toString());
}

View file

@ -75,7 +75,7 @@ export const InboxSidebar: FC<IInboxSidebarProps> = observer((props) => {
)}
onClick={() => {
if (currentTab != option?.key) {
handleCurrentTab(option?.key);
handleCurrentTab(workspaceSlug, projectId, option?.key);
router.push(`/${workspaceSlug}/projects/${projectId}/inbox?currentTab=${option?.key}`);
}
}}

View file

@ -18,7 +18,10 @@ export const PagesListView: React.FC<TPageView> = observer((props) => {
// store hooks
const { isAnyPageAvailable, getAllPages } = useProjectPages();
// fetching pages list
useSWR(projectId ? `PROJECT_PAGES_${projectId}` : null, projectId ? () => getAllPages(pageType) : null);
useSWR(
projectId ? `PROJECT_PAGES_${projectId}` : null,
projectId ? () => getAllPages(workspaceSlug, projectId, pageType) : null
);
// pages loader
return (